5

我在大学的最后一年,所以是编程方面的菜鸟,尤其是 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 和足够的其他知识来完成这项工作,谷歌没有帮助。有没有人可以帮助我开始这个项目并解释我出了什么问题。

编辑:在我对项目 .Server 重复所有步骤后,它工作正常,但如果它是在共享中完成的,它就不起作用。

4

1 回答 1

1

对我来说,这个错误只发生在我激活链接器时,所以在发布版本时。只要您不想将其实际运送给客户,您就可以在没有链接的情况下进行构建,并且它应该可以工作。根据您的项目,输出将是链接的三倍。

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

对于发布版本,我还没有找到解决方案。可能需要查看 AspNetCore 存储库以在那里查找或提出问题。

于 2020-04-24T10:39:26.817 回答