C# 如何将目标框架从.net 5.0转换为.net标准?
我正在使用.net中的基本libs(没有libs,只能在.NETCore中访问)。当我尝试将.csproj文件中的目标框架从.net 5.0更改为.net标准时C# 如何将目标框架从.net 5.0转换为.net标准?,c#,.net,.net-standard,.net-5,C#,.net,.net Standard,.net 5,我正在使用.net中的基本libs(没有libs,只能在.NETCore中访问)。当我尝试将.csproj文件中的目标框架从.net 5.0更改为.net标准时dotnet run命令似乎不起作用,错误消息如下: Unable to run project. Please make sure you have a runnable project type and "dotnet run" supports this project. A runnable project s
dotnet run
命令似乎不起作用,错误消息如下:
Unable to run project.
Please make sure you have a runnable project type and "dotnet run" supports this project.
A runnable project should be oriented to a runnable TFM (for example, net5.0) with an output type of "exe".
The current outputtype is "exe".
由于错误信息是中文的,我只是粗略地把它翻译成英文。这可能不是很准确。我想找到转换TFM的正确方法。NET标准是API标准,不是框架,可执行文件不能针对它,只有库可以。我想制作一个NuGet包,如何将框架设置为.NET标准?发布时更改此选项?如果您正在创建包,则无需运行
dotnet
dotnetpack
生成一个包。所以我可以将TFM更改为netstandard2.1
和dotnetpack,然后我就可以解决这个问题了?