.NET Blazor错误MSB3073,在构建应用程序时以及如何对其进行修复时,删除Blazor.MonoRuntime.targets中的行无法使其

时间:2018-12-04 23:19:16

标签: .net webassembly blazor

我去年上大学,所以对编程特别是Blazor来说是个菜鸟。 启动项目,安装nuget包EntityFrameworkCore,EntityFrameworkCore.SqlServer和EntityFrameworkCore.Tools之后显示此错误,然后我在此行中架设本地数据库(这就是为什么我要指定con字符串)

Scaffold-DbContext "Data Source=DESKTOP-VF53KDE;Initial Catalog=studAdmin;
Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" 
Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Tables dvorana ,evidencijaBoravka ,grupa ,mjesto ,
nastavnik ,orgjed ,predmet ,predmetgrupa ,student ,upisanpredmet ,zupanija

。直到这一刻,我可以构建应用程序,但是在搭建脚手架后,我得到了这样的错误

Error   MSB3073 The command "dotnet "C:\Users\Tomislav\.nuget\packages\
microsoft.aspnetcore.blazor.build\0.6.0\targets\../tools/illink/illink.dll" -l none --verbose 
--strip-security true --exclude-feature com --exclude-feature sre -v false -c link -u link
-b true -d "C:\Users\Tomislav\.nuget\packages\microsoft.aspnetcore.blazor.build\0.6.0\
targets\../tools/mono/bcl/" -d "C:\Users\Tomislav\.nuget\packages\microsoft.aspnetcore.blazor.build
\0.6.0\targets\../tools/mono/bcl/Facades/" -o "C:\Users\Tomislav\Documents\Visual Studio 2017\Projects\Project\Project.Client\obj\Debug\
netstandard2.0\blazor\linker/" -x "C:\Users\Tomislav\.nuget\packages\
microsoft.aspnetcore.blazor.build\0.6.0\targets\BuiltInBclLinkerDescriptor.xml" -x "C:\Users\Tomislav\
Documents\Visual Studio 2017\Projects\Project\Project.Client\obj\Debug\netstandard2.0\blazor\linker.descriptor.xml" -a
 "C:\Users\Tomislav\.nuget\packages\
microsoft.aspnetcore.blazor\0.6.0\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.dll" -a 
"C:\Users\Tomislav\.nuget\packages\microsoft.aspnetcore.blazor.browser\0.6.0\lib\netstandard2.0\
Microsoft.AspNetCore.Blazor.Browser.dll" -a "C:\Users\Tomislav\.nuget\
packages\microsoft.aspnetcore.blazor.build\0.6.0\lib\netstandard1.0\Microsoft.AspNetCore.Blazor.TagHelperWorkaround.dll" -a "C:\Users\Tomislav\.nuget\packages\
microsoft.entityframeworkcore\2.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll" -a "C:\Users\Tomislav\.nuget\packages\microsoft.entityframeworkcore.abstractions\2.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Abstractions.dll" -a "C:\Users\Tomislav\.nuget\packages\microsoft.entityframeworkcore.relational\2.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll" -a "C:\Users\Tomislav\.nuget\packages\microsoft.entityframeworkcore.sqlserver\2.1.4\lib\netstandard2.0\Microsoft.EntityFrameworkCore.SqlServer.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.caching.abstractions\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.caching.memory\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration.abstractions\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.configuration.binder\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.dependencyinjection\2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.dependencyinjection.abstractions\2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.logging\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.logging.abstractions\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.options\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Options.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.primitives\2.1.1\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll" -a "C:\Users\Tomislav\.nuget\packages\microsoft.jsinterop\0.6.0\lib\netstandard2.0\Microsoft.JSInterop.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.win32.registry\4.5.0\lib\netstandard2.0\Microsoft.Win32.Registry.dll" -a "C:\Users\Tomislav\.nuget\packages\mono.webassembly.interop\0.6.0\lib\netstandard2.0\Mono.WebAssembly.Interop.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\remotion.linq\2.2.0\lib\netstandard1.0\Remotion.Linq.dll" -a "C:\Users\Tomislav\.nuget\packages\system.buffers\4.4.0\lib\netstandard2.0\System.Buffers.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.collections.immutable\1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel.annotations\4.5.0\lib\netstandard2.0\System.ComponentModel.Annotations.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.data.sqlclient\4.5.1\lib\netstandard2.0\System.Data.SqlClient.dll" -a "C:\Users\Tomislav\.nuget\packages\system.diagnostics.diagnosticsource\4.5.1\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.interactive.async\3.1.1\lib\netstandard1.3\System.Interactive.Async.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq\4.1.0\lib\netstandard1.6\System.Linq.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq.expressions\4.1.0\lib\netstandard1.6\System.Linq.Expressions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.linq.queryable\4.0.1\lib\netstandard1.3\System.Linq.Queryable.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.memory\4.5.1\lib\netstandard2.0\System.Memory.dll" -a "C:\Users\Tomislav\.nuget\packages\system.numerics.vectors\4.4.0\lib\netstandard2.0\System.Numerics.Vectors.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.objectmodel\4.0.12\lib\netstandard1.3\System.ObjectModel.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit\4.0.1\lib\netstandard1.3\System.Reflection.Emit.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit.ilgeneration\4.0.1\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.emit.lightweight\4.0.1\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.reflection.typeextensions\4.1.0\lib\netstandard1.5\System.Reflection.TypeExtensions.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.runtime.compilerservices.unsafe\4.5.1\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.accesscontrol\4.5.0\lib\netstandard2.0\System.Security.AccessControl.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.principal.windows\4.5.0\lib\netstandard2.0\System.Security.Principal.Windows.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.text.encoding.codepages\4.5.0\lib\netstandard2.0\System.Text.Encoding.CodePages.dll" -a "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.threading\4.0.11\lib\netstandard1.3\System.Threading.dll" -a "C:\Users\Tomislav\Documents\Visual Studio 2017\Projects\Project\Project.Shared\bin\Debug\netstandard2.0\Project.Shared.dll" -a "C:\Users\Tomislav\Documents\Visual Studio 2017\Projects\Project\Project.Client\obj\Debug\netstandard2.0\Project.Client.dll"" exited with code 1.  Project.Client  C:\Users\Tomislav\.nuget\packages\microsoft.aspnetcore.blazor.build\0.6.0\targets\Blazor.MonoRuntime.targets    447 

双击错误文件Blazor.Monotime.targets将打开

<!--  I deleted this row -->
<Exec Command="dotnet &quot;$(MonoLinkerPath)&quot; $(_BlazorLinkerAdditionalOptions) 
@(_BlazorFolderLookupPaths, ' ') -o &quot;$(BlazorIntermediateLinkerOutputPath)&quot; 
@(_BlazorAssemblyDescriptorFiles, ' ') @(_BlazorAssembliesToLink, ' ')"  />

并删除此行使我可以构建应用程序,但是它只是正在加载并且无法正常工作。 正如我所看到的,这行中有错误,但是我根本不了解bash和足够的其他知识来完成这项工作,而Google却无济于事。 有没有人可以帮助我启动项目并向我解释问题所在。

编辑:在项目.Server上重复了所有步骤之后,它可以正常工作,但是如果以共享方式完成,则无法正常工作。

1 个答案:

答案 0 :(得分:1)

对我来说,仅当我激活链接器时才会发生此错误,因此在构建发行版时会发生。您可以构建而无需链接,只要您不希望将其实际交付给客户,它就可以正常工作。输出将是链接的三倍,具体取决于您的项目。

在您的情况下,这意味着不使用配置“链接”,而是不使用链接的另一个配置,通常是“调试”。

对于Release版本,我还没有找到解决方案。可能需要查看AspNetCore存储库才能在其中找到问题。