Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Blazor error MSB3073 when building app but and how to fix it, deleting row in Blazor.MonoRuntime.targets doesn't make it

I am on last year of college so am a noob in programming and especially Blazor. This error showes after starting project, installing nuget packages EntityFrameworkCore, EntityFrameworkCore.SqlServer and EntityFrameworkCore.Tools and then i scaffold my local database (that's why i give con string) with this line

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

. Till this moment I could build app but after scaffolding i get error like this

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 

After double click to error file Blazor.Monotime.targets opens on line

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

and deleting this line let me build the app but then it is just loading and not working. And as I see error is in this line but I simply don't know bash and enough other knowledge to make this work and google didn't help. Is there anyone to help me start the project and to explain me what is wrong.

EDIT: After I repeated this all steps on project .Server it worked fine, but if it is done in shared it doesn't work.

like image 436
mitotomi Avatar asked Nov 07 '22 23:11

mitotomi


1 Answers

For me, this error only happens when I activate the linker, so when making a release build. You can build without linking as long as you don't want to actually ship it to a customer, and it should work. The output will just be thrice as big as with linking, depending on your project.

In your case this means to not use the configuration "link", but another one that doesn't include linking, usually "Debug".

For Release builds, I haven't found a solution yet. Might need to look at the AspNetCore repo to find or make an issue there.

like image 62
Squirrelkiller Avatar answered Nov 15 '22 10:11

Squirrelkiller