Repro steps:
Expected result: Template is created cleanly without warnings or errors
Actual result: The following error shows up in the Error List (even though the template builds and runs cleanly):
The "ResolveBlazorRuntimeDependencies" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'BlazorApp5.dll' or one of its dependencies. The system cannot find the file specified.
File name: 'BlazorApp5.dll' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Microsoft.AspNetCore.Components.WebAssembly.Build.ResolveBlazorRuntimeDependencies.ResolveRuntimeDependenciesCore(String entryPoint, IEnumerable`1 applicationDependencies, IEnumerable`1 monoBclAssemblies)
at Microsoft.AspNetCore.Components.WebAssembly.Build.ResolveBlazorRuntimeDependencies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Workaround: Close and reopen the solution.
Closing as can't reproduce this any more.
This is still a thing.
I have had this happen on 2 machines now.
This has been a problem since the new template came out.
@spmoran-blazor @ImmutableVector Have you confirmed that you are using SDK version 3.1.102 or later? Are you possibly using an older preview build of 3.1.200 that shipped with a VS preview? If you are, could you try updating to the latest 16.5 preview and see if that helps?
@danroth27 My sdk is good, and I was running 16.4.6.
After installing the Preview build I have confirmed this is working! I apologies if that was part of the steps to get everything up and running initially. And seriously, thanks for the quick feed back!
Got the same issue on March 27 and resolved it by updating my visual studio 2019 to the latest version.
Updating VS fixed this error, but the Blazor Server project is now throwing a 500.0 Module "AspNetCoreModule" could not be found error.
Most helpful comment
Got the same issue on March 27 and resolved it by updating my visual studio 2019 to the latest version.