Base solution for your next web application
Open Closed

Access Denied Error executing Web.Host while attempting to debug per the .NET Maui Development Guide #11498


User avatar
0
johnmalone created

I am following the instructions in the .NET Maui Development Guide.

At the debugging step, I am getting "Access Denied" when starting the Web.Host project in any of the 3 ways mentioned in the instructions.

Debugging Host To start debugging MAUI app you need to configure host settings. You can use Web.Host to feed the MAUI app. Open Windows Command Prompt. Go to the folder where your Web.Host csproj file is located. Then run the command below to start hosting your Web API:

dotnet run --launch-profile Mobile Bash This will start the Web.Host project from the address "https://0.0.0.0:44301" which enables to access it from external networks.

Alternatively, there's start-host-mobile.bat file in your Web.Host directory which does the same for Windows users.

Warning

If you want to start Web.Host from Visual Studio, set Web.Host as startup project and choose the Mobile profile.


Here is the error I am getting:

C:\Source\MAUI Portal\src\Allworth.Portal.Web.Host>start-host-mobile.bat Unhandled exception: System.ComponentModel.Win32Exception (5): An error occurred trying to start process 'C:\Source\MAUI Portal\src\Allworth.Portal.Web.Host\bin\Debug\net7.0\Allworth.Portal.Web.Host.exe' with working directory 'C:\Source\MAUI Portal\src\Allworth.Portal.Web.Host'. Access is denied. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted) at Microsoft.DotNet.Tools.Run.RunCommand.Execute() at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<

This does not appear to be a Windows file permissions error or a file blocked by Windows.

Can anyone help me get past this error?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @johnmalone

    We haven't faced a similar error before. Does that work if you start a command prompt with Administrative permissions and then run start-host-mobile.bat using this command prompt ?

  • User Avatar
    0
    johnmalone created

    Yes, I tried that. Still same Access Denied error. I've spent hours trying to figure this out. I hope someone can help, or maybe I will have a breakthrough soon.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you check Windows Event Viewer logs and see if there are any useful error logs ?