AssetsTools.NET icon indicating copy to clipboard operation
AssetsTools.NET copied to clipboard

AT3 TextureFile.DecodeManaged throws "Could not load file or assembly 'System.Half'"

Open SwingCosmic opened this issue 2 years ago • 1 comments

Environment:

  • .NET 7
  • AssetsTools.NET.Texture 1.0.0-preview2
  • AssetsTools.NET 3.0.0-preview3
System.IO.FileNotFoundException: Could not load file or assembly 'System.Half, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 系统找不到指定的文件。
File name: 'System.Half, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at AssetsTools.NET.Texture.TextureFile.DecodeManaged(Byte[] data, TextureFormat format, Int32 width, Int32 height, Boolean useBgra)
   at AssetsTools.NET.Texture.TextureFile.GetTextureData(String rootPath, Boolean useBgra)
   at AssetsTools.NET.Texture.TextureFile.GetTextureData(AssetsFileInstance inst)

If I copy this method code and run directly this exception will not to throw any more.

Actually, System.Half is in System.Runtime.dll, not System.Half.dll

image

SwingCosmic avatar Jul 16 '23 11:07 SwingCosmic

I thought I already fixed this on the last update, but this can be solved by building directly for .net 6 (what I'm doing for UABEA right now.) I'm going to figure out Monobehaviours being broken and make one last prerelease for all the packages. When I do that I'll make sure to build this for .net 6.

nesrak1 avatar Jul 16 '23 14:07 nesrak1