无法在JetBrains Rider中构建或运行我的.NET应用程序



我正在Ubuntu 20.04.1上试用JetBrains Rider,我刚刚从OneDrive下载了一个.NET应用程序到我的Linux机器。当我打开JetBrains Rider时,每当我想运行或构建我的应用程序时,就会出现以下错误:

Done building project "InterviewTest.csproj" -- FAILED.
Build FAILED.
/usr/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2101,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Entity". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
CSC : error CS0041: Unexpected error writing debug information -- 'Operation is not supported on this platform.'
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.42

我之前尝试删除以下2个包:

  • Microsoft.CodeDom.Providers.DotNetCompilerPlatform
  • Microsoft.Net.Compilers

如此问题中所建议的:CSC:error CS0041:写入调试信息时出现意外错误-';此平台不支持操作';

但突出显示的解决方案似乎对我不起作用。

更新:我刚刚意识到这个项目可能不是一个>NET标准应用程序。该应用程序似乎在Windows上运行良好,但根据Jetbrains网站的说法,我在linux上运行该应用程序应该不会有问题。

正如Lex所提到的,包System.Web.Entity不是符合.NET标准的包。如果你想运行它,你必须通过转到Rider>Preferences>Build, Execution, Deployment>Toolset and Build>Use MSBuild version并选择Mono运行时。

最新更新