C# dotnet核心方法&x27;验证选项'。。。没有实现

C# dotnet核心方法&x27;验证选项'。。。没有实现,c#,asp.net-core,.net-core,C#,Asp.net Core,.net Core,我正在构建一个.NET核心解决方案,它构建得很好,但当我试图发布它时,它出现了以下错误: Method 'ValidateOptions' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' do

我正在构建一个.NET核心解决方案,它构建得很好,但当我试图发布它时,它出现了以下错误:

Method 'ValidateOptions' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
     at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create
     at Microsoft.CodeAnalysis.Razor.CompilationTagHelperFeature.GetDescriptors()
     at Microsoft.AspNetCore.Razor.Language.DefaultRazorTagHelperBinderPhase.ExecuteCore(RazorCodeDocument codeDocument)
     at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document)
     at Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument codeDocument)
     at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.PrecompileRunCommand.<>c__DisplayClass23_0.<GenerateCode>b__0(Int32 i)
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)   --- End of stack trace from previous location where exception was thrown ---
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
     at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
     at System.Threading.Tasks.TaskReplicator.Replica.Execute()
程序集“Microsoft.CodeAnalysis.CSharp,版本=2.3.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35”中类型“Microsoft.CodeAnalysis.CSharp.CSharpCompileationOptions”中的方法“ValidateOptions”没有实现。 在Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create上 在Microsoft.CodeAnalysis.Razor.CompilationTagHelperFeature.GetDescriptors()上 位于Microsoft.AspNetCore.Razor.Language.DefaultRazorTagHelperBinderPhase.ExecuteCore(RazorCodeDocument代码文档) 位于Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument文档) 位于Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument代码文档) 在Microsoft.AspNetCore.Mvc.Razor.viewcomployment.Internal.PrecompileRunCommand.c__显示类23_0.b_u0(Int32 i) 在System.Threading.Tasks.Parallel.c___DisplayClass19_0`1.b__1(RangeWorker和currentWorker、Int32 timeout、Boolean和ReplicationLegateFieldBeforeCompletion)---从引发异常的上一个位置开始的堆栈结束跟踪--- 在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中 在System.Threading.Tasks.Parallel.c___显示器上显示Class19_0`1.b__1(RangeWorker和currentWorker、Int32 timeout、Boolean和ReplicationLegateFieldBefore Completion) 在System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(布尔值&yieldedBeforeCompletion) 在System.Threading.Tasks.TaskReplicator.Replica.Execute()中 更详细地说,我得到了以下信息(我不知道这是否明显更好):

1:10>从项目“D:\Projects\MySolution\MySolution.App\MySolution.App.csproj”中的文件“C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.mvc.razor.razor.viewcomilation.targets”中的目标“\u RunForCore”(目标“\u MvcRazorPrecompile”取决于此):
使用程序集“C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.Tasks.dll”中的“GetDotNetHost”任务。
任务“GetDotNetHost”
已完成执行任务“GetDotNetHost”。
使用程序集“Microsoft.Build.Tasks.Core,版本=15.1.0.0,区域性=neutral,PublicKeyToken=b03f5f7f11d50a3a”中的“Exec”任务。
任务“Exec”
“C:\Program Files\dotnet\dotnet.exe”exec--runtimeconfig“D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.runtimeconfig.json”-depsfile“D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.deps.json”“C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.dll”@“obj\Debug\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp”
程序集“Microsoft.CodeAnalysis.CSharp,版本=2.3.0.0,区域性=中性,PublicKeyToken=31bf3856ad364e35”中类型“Microsoft.CodeAnalysis.CSharp.CSharpCompileationOptions”中的方法“ValidateOptions”没有实现。
在Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create上
在Microsoft.CodeAnalysis.Razor.CompilationTagHelperFeature.GetDescriptors()上
位于Microsoft.AspNetCore.Razor.Language.DefaultRazorTagHelperBinderPhase.ExecuteCore(RazorCodeDocument代码文档)
位于Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument文档)
位于Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument代码文档)
在Microsoft.AspNetCore.Mvc.Razor.viewcomployment.Internal.PrecompileRunCommand.c__显示类23_0.b_u0(Int32 i)
在System.Threading.Tasks.Parallel.c___显示器上显示Class19_0`1.b__1(RangeWorker和currentWorker、Int32 timeout、Boolean和ReplicationLegateFieldBefore Completion)
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Threading.Tasks.Parallel.c___显示器上显示Class19_0`1.b__1(RangeWorker和currentWorker、Int32 timeout、Boolean和ReplicationLegateFieldBefore Completion)
在System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(布尔值&yieldedBeforeCompletion)
在System.Threading.Tasks.TaskReplicator.Replica.Execute()中
1:10>C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcomilation\2.0.2\build\netstandard2.0\microsoft.aspnetcore.mvc.razor.viewcomilation.targets(60,5):错误MSB3073:命令“C:\Program Files\dotnet\dotnet.exe”exec--runtimeconfig“D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.runtimeconfig.json”--depsfile“D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.deps.json”C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcomilation\2.0.2\build\netstandard2.0\microsoft.aspnetcore.mvc.razor.viewcomilation.dll“@”obj\Debug\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcomilation.rsp”退出,代码为1。[D:\Projects\MySolution\MySolution.App\MySolution.App.csproj]
已完成执行任务“Exec”--失败。
1:10>已完成在项目“MySolution.App.csproj”中构建目标“\u RunForCore”——失败。
已完成执行任务“CallTarget”--失败。
1:10>已完成在项目“MySolution.App.csproj”中构建目标“MvcRazorPrecompile”——失败。
1:10>已完成生成项目“D:\Projects\MySolution\MySolution.App\MySolution.App.csproj”(发布目标)——失败。
生成失败。
有人能告诉我这是什么吗?我怎样才能阻止它爆炸?这件事最近才开始发生,我
  1:10>Target "_RunForCore" in file "C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets" from project "D:\Projects\MySolution\MySolution.App\MySolution.App.csproj" (target "_MvcRazorPrecompile" depends on it):
       Using "GetDotNetHost" task from assembly "C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll".
       Task "GetDotNetHost"
       Done executing task "GetDotNetHost".
       Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
       Task "Exec"
         "C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig "D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.runtimeconfig.json" --depsfile "D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.deps.json" "C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Debug\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"
         Method 'ValidateOptions' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
            at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create
            at Microsoft.CodeAnalysis.Razor.CompilationTagHelperFeature.GetDescriptors()
            at Microsoft.AspNetCore.Razor.Language.DefaultRazorTagHelperBinderPhase.ExecuteCore(RazorCodeDocument codeDocument)
            at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document)
            at Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine.GenerateCode(RazorCodeDocument codeDocument)
            at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.PrecompileRunCommand.<>c__DisplayClass23_0.<GenerateCode>b__0(Int32 i)
            at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
            at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
            at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
            at System.Threading.Tasks.TaskReplicator.Replica.Execute()
  1:10>C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(60,5): error MSB3073: The command ""C:\Program Files\dotnet\dotnet.exe" exec --runtimeconfig "D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.runtimeconfig.json" --depsfile "D:\Projects\MySolution\MySolution.App\bin\netcoreapp2.0\MySolution.App.deps.json" "C:\Users\Jeremy Holovacs\.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.2\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Debug\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 1. [D:\Projects\MySolution\MySolution.App\MySolution.App.csproj]
       Done executing task "Exec" -- FAILED.
  1:10>Done building target "_RunForCore" in project "MySolution.App.csproj" -- FAILED.
       Done executing task "CallTarget" -- FAILED.
  1:10>Done building target "MvcRazorPrecompile" in project "MySolution.App.csproj" -- FAILED.
  1:10>Done Building Project "D:\Projects\MySolution\MySolution.App\MySolution.App.csproj" (Publish target(s)) -- FAILED.

Build FAILED.
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>