我的C#程序集当前全部针对.NET Core 3.1。它们都使用我针对.NET Framework 4.8的C++ / CLI程序集(称之为“MySdk”)。这个过程很顺利。
今天,我尝试将C#程序集更新到.NET 5.0。突然间,它们甚至看不到已经构建好且就在那里的.NET FW 4.8“ MySdk”程序集。构建过程会给出以下输出:
> 2>------ Build started: Project: MyApp.Core, Configuration: Debug x64
> ------ 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5):
> warning MSB3245: Could not resolve this reference. Could not locate
> the assembly "MySdk". Check to make sure the assembly exists on disk.
> If this reference is required by your code, you may get compilation
> errors.
明显的解决方案是将C++/CLI程序集更新到.NET 5,我希望能尽快完成,但我不确定是否可行。
但假设现在没有这个选项。 .NET 5程序集是否可以使用.NET FW 4.8程序集?这是否有效?还有其他什么方法可以使我的.NET 5程序集看到和使用它?