Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }.
Closed this issue · 7 comments
I created a project with .Net 3.1 exactly as I saw in the project source but when I set the .server project as startup I get this error:
Cannot find the fallback endpoint specified by route values: { page: /_Host, area: }.
when I set the .client project as startup I get:
No webpage was found for the web address: http://localhost:60773/
I want to use this project since someone said I can make a client side project and debug it like the server side.
How do I run the project correctly?
Have you moved the index.html
from the .Client
project as _Host.cshtml
into the Pages
directory of the .Server
project like in the sample code?
Visual studio brought a golden bar that says an invalidoperationexception happened and that it can be caused by an extension, And the log file it showed me has two areas of errors: (I didn't install any extensions after installing vs 2019 preview)
224 | ERROR | Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.VisualStudio.CppSvc.Internal, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\CommonExtensions\Microsoft\CodeAnalysis\Microsoft.VisualStudio.CodeAnalysis.VCPlugin.dll | Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost | 2019/11/15 17:29:31.232 | ||
---|---|---|---|---|---|---|
664 | ERROR | System.InvalidOperationException: The operation failed as details for project MiladJob.Server could not be loaded. at NuGet.PackageManagement.VisualStudio.NetCorePackageReferenceProject.GetPackageSpecsAsync(DependencyGraphCacheContext context) at NuGet.PackageManagement.DependencyGraphRestoreUtility.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__16.MoveNext() | NuGet Package Manager | 2019/11/15 17:31:56.836 | ||
733 | ERROR | System.InvalidOperationException: The operation failed as details for project MiladJob.Server could not be loaded. at NuGet.PackageManagement.VisualStudio.NetCorePackageReferenceProject.GetPackageSpecsAsync(DependencyGraphCacheContext context) at NuGet.PackageManagement.DependencyGraphRestoreUtility.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.SolutionRestoreManager.SolutionRestoreJob.d__16.MoveNext() | NuGet Package Manager | 2019/11/15 17:32:37.235 | ||
742 | ERROR | Loading UI library |
866 | ERROR | System.InvalidOperationException: Writing is not allowed after writer was completed. at System.IO.Pipelines.Pipe.GetMemory(Int32 sizeHint) at System.IO.Pipelines.Pipe.DefaultPipeWriter.GetMemory(Int32 sizeHint) at StreamJsonRpc.HeaderDelimitedMessageHandler.Write(JsonRpcMessage content, CancellationToken cancellationToken) at StreamJsonRpc.PipeMessageHandler.WriteCoreAsync(JsonRpcMessage content, CancellationToken cancellationToken) at StreamJsonRpc.MessageHandlerBase.d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at StreamJsonRpc.JsonRpc.d__118.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.ValueTask.ThrowIfCompletedUnsuccessfully() at StreamJsonRpc.JsonRpc.d__102.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at StreamJsonRpc.JsonRpc.d__961.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.CodeLens.Proxy.CodeLensHubClient.<>c__DisplayClass22_0 1.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.d__36`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) |
---|
I commented out these two Item groups in Project xml file and project runs:
`<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<!--<ItemGroup>
<Content Remove="Pages\_host.cshtml" />
</ItemGroup>
<ItemGroup>
<None Include="Pages\_Host.cshtml" />
</ItemGroup>-->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.1.0-preview2.19528.8" />
</ItemGroup>
`
Now How do I run and debug Client project?
You run the .Server
(always), and if you need debugging, you run in server mode by appending ?mode=server
, then you can set breakpoints in your .Client
project and hit them
One more question please: How do I deploy client project to a static file server without an index.html in wwwroot folder? I only need the client project, Thank you in advance.
In that case you need to keep your index.cshtml
around and in sync with _Host.cshtml