Aspnetcore: Blazor CLI app doesn't run.

Created on 16 Feb 2019  路  3Comments  路  Source: dotnet/aspnetcore

Describe the bug

Following the CLI instructions from here: https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/blazor/get-started?view=aspnetcore-3.0&tabs=netcore-cli using Windows 10 Pro (Version 10.0.17763.316) and VS2019 (Version 16.0.0 Preview 3.0) on 64-bit. From a VS2019 Developer Command Prompt, I run:

dotnet new -i Microsoft.AspNetCore.Blazor.Templates

dotnet new blazor -o WebApplication1
cd WebApplication1
dotnet run

I get the following error only, and nothing else happens aftewards:

Unable to generate deps.json, it may have been already generated.  You can specify 
the "-d" option before the tool name for diagnostic output (for example, 
"dotnet -d <toolname>": C:\Program Files\dotnet\sdk\3.0.100-preview-010184
\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj

Note that I CAN successfully run:

dotnet restore
dotnet build

And there are no errors. Also, if I load this same project in VS2019, I get the same error.

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of ASP.NET Core 3.0.100-preview-010184, Windows 10 Pro 10.0.17763.316 and VS2019 Preview (Version 16.0.0 Preview 3.0)
  2. Run this code dotnet new blazor -o WebApplication1, cd WebApplication1, and dotnet run
  3. See error Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d <toolname>": C:\Program Files\dotnet\sdk\3.0.100-preview-010184\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps\GenerateDeps.proj

Expected behavior

I assume the app should run and in a self-hosted web server or in IIS express.

Additional context

The output of dotnet --info:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview-010184
 Commit:    c57bde4593

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview-010184\

Host (useful for support):
  Version: 3.0.0-preview-27324-5
  Commit:  63a01b08e5

.NET Core SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.500 [C:\Program Files\dotnet\sdk]
  2.1.502 [C:\Program Files\dotnet\sdk]
  2.1.504 [C:\Program Files\dotnet\sdk]
  2.1.600-preview-009426 [C:\Program Files\dotnet\sdk]
  2.1.600-preview-009497 [C:\Program Files\dotnet\sdk]
  3.0.100-preview-010184 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview-19075-0444 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview-27324-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview-27325-3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
area-blazor

Most helpful comment

Update: I found this https://github.com/aspnet/Docs/issues/10915#issuecomment-463080794 for some magical reason, if you create a console app in another directory, and then come back to the Blazor project.

Strange workaround, but it does WORK.

All 3 comments

Update: I found this https://github.com/aspnet/Docs/issues/10915#issuecomment-463080794 for some magical reason, if you create a console app in another directory, and then come back to the Blazor project.

Strange workaround, but it does WORK.

Got the same error following latest SDK by the book:

dotnet --version
3.0.100-preview3-010431
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::0.9.0-preview3-19154-02
dotnet -d run
Telemetry is: Enabled
Running dotnet blazor serve
Process ID: 60996
Telemetry is: Enabled
projectfactory: MSBUILD_EXE_PATH = /usr/local/share/dotnet/sdk/3.0.100-preview3-010431/MSBuild.dll
projectfactory: MSBuild project path = /Users/piotrblazejewicz/git/WebApplication1/WebApplication1.csproj
projecttoolscommandresolver: resolving commandspec from 1 Tool Libraries.
projecttoolscommandresolver: Attempting to resolve command spec from tool Microsoft.AspNetCore.Blazor.Cli
projecttoolscommandresolver: nuget packages root:
- /Users/piotrblazejewicz/.nuget/packages/
- /usr/local/share/dotnet/sdk/NuGetFallbackFolder
projecttoolscommandresolver: found tool lockfile at : /Users/piotrblazejewicz/.nuget/packages/.tools/microsoft.aspnetcore.blazor.cli/0.9.0-preview3-19154-02/netcoreapp3.0/project.assets.json
projecttoolscommandresolver: expect deps.json at: /Users/piotrblazejewicz/.nuget/packages/.tools/microsoft.aspnetcore.blazor.cli/0.9.0-preview3-19154-02/netcoreapp3.0/Microsoft.AspNetCore.Blazor.Cli.deps.json
Generating deps.json at: /Users/piotrblazejewicz/.nuget/packages/.tools/microsoft.aspnetcore.blazor.cli/0.9.0-preview3-19154-02/netcoreapp3.0/Microsoft.AspNetCore.Blazor.Cli.deps.json
MSBuild arguments: /usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/GenerateDeps/GenerateDeps.proj -property:ProjectAssetsFile=\"/Users/piotrblazejewicz/.nuget/packages/.tools/microsoft.aspnetcore.blazor.cli/0.9.0-preview3-19154-02/netcoreapp3.0/project.assets.json\" -property:ToolName=Microsoft.AspNetCore.Blazor.Cli -property:ProjectDepsFilePath=/var/folders/f7/fldvv8tx3fb4pstk_sr2nk080000gn/T/tmprw9s1S.tmp -property:TargetFramework=netcoreapp3.0
Unable to generate deps.json, it may have been already generated.  You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d <toolname>": Microsoft (R) Build Engine version 16.0.443+g5775d0d6bb for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
/usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.TargetingPackResolution.targets(157,5): error NETSDK1073: The FrameworkReference 'Microsoft.NETCore.App' was not recognized [/usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/GenerateDeps/GenerateDeps.proj]


Microsoft.DotNet.Cli.Utils.GracefulException: Unable to generate deps.json, it may have been already generated.  You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d <toolname>": /usr/local/share/dotnet/sdk/3.0.100-preview3-010431/Sdks/Microsoft.NET.Sdk/targets/GenerateDeps/GenerateDeps.proj
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.GenerateDepsJsonFile(LockFile toolLockFile, NuGetFramework framework, String depsPath, SingleProjectInfo toolLibrary, String toolDepsJsonGeneratorProject)
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.GetToolDepsFilePath(SingleProjectInfo toolLibrary, NuGetFramework framework, LockFile toolLockFile, String depsPathRoot, String toolDepsJsonGeneratorProject)
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.ResolveCommandSpecFromToolLibrary(SingleProjectInfo toolLibraryRange, String commandName, IEnumerable`1 args, IProject project)
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.ResolveCommandSpecFromAllToolLibraries(IEnumerable`1 toolsLibraries, String commandName, IEnumerable`1 args, IProject project)
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.ResolveFromProjectTools(CommandResolverArguments commandResolverArguments)
   at Microsoft.DotNet.CommandFactory.ProjectToolsCommandResolver.Resolve(CommandResolverArguments commandResolverArguments)
   at Microsoft.DotNet.CommandFactory.CompositeCommandResolver.Resolve(CommandResolverArguments commandResolverArguments)
   at Microsoft.DotNet.CommandFactory.CommandResolver.TryResolveCommandSpec(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName)
   at Microsoft.DotNet.CommandFactory.CommandFactoryUsingResolver.Create(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)

Thanks for contacting us, @RobSeder.
This is going to be fixed as part of #8243.

Was this page helpful?
0 / 5 - 0 ratings