![](/img/trans.png)
[英]Could not load type 'System.Runtime.CompilerServices.AsyncVoidMethodBuilder' from assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral
[英]TypeLoadException : Could not resolve type (from typeref, class/assembly System.IO.Stream, System.Runtime, Version=4.2.2.0, Culture=neutral)
TypeLoadException:無法使用標記 xx 解析類型(來自類型引用、類/程序集 System.IO.Stream、System.Runtime、Version=4.2.2.0、Culture=neutral、PublicKeyToken=xx)
我是 C# 和 Unity 的新手
我已經使用 Visual Studio 使用.Net Core 3.1創建了 dll
在Unity 中使用 dll (使用 .Net 4.x)
我可以成功運行正常代碼。 但是,在 dll 代碼中使用 GetResponseStream() 時,我在 Unity 中收到此錯誤。
我的庫項目和 Unity 項目中使用的版本是否兼容? 如何在我的 C# 項目中成功使用 Stream 閱讀代碼?
我只是在 Unity 項目中復制 dll,我還需要復制其他東西嗎?
您需要將代碼重新編譯為 .NET Framework 4.x DLL 而不是 .NET core 3.1 DLL。 Unity 不支持 .NET Core 配置文件。
從技術上講,.NET Standard 2.0 也受支持,具體取決於您所針對的 Unity 版本,但在較新的版本中已棄用/刪除。
供參考: https : //docs.unity3d.com/2019.1/Documentation/Manual/dotnetProfileSupport.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.