无法在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: Unexpected error writing debug information -- 'Operation is not supported on this platform.'

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

更新:我刚刚意识到这个项目可能不是> NET Standard应用程序。该应用程序似乎可以在Windows上正常运行,但是根据Jetbrains网站的说法,我在Linux上运行该应用程序应该没有问题。

解决方法

如Lex所述,程序包System.Web.Entity不是.NET Standard兼容程序包。如果要运行它,则必须尝试通过以下方法针对Mono运行它:转到Rider> Preferences> Build,Execution,Deployment> Toolset and Build> Use MSBuild version并选择Mono运行时。