Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Start Maui Tutorial on Windows #130

Open
markgr opened this issue Jan 2, 2024 · 2 comments
Open

Cannot Start Maui Tutorial on Windows #130

markgr opened this issue Jan 2, 2024 · 2 comments

Comments

@markgr
Copy link

markgr commented Jan 2, 2024

Ok so this is really weird

So Env: - Visual Studio 17.8.3
Dotnet SDKS: 8.0.100
All workloads up to date

I download the whole Git repo - I then open the DotNet MAUI tutorial project maui-samples\8.0\Tutorials\CreateNetMauiApp - Step 1

Build for windows - I get the following exception

image

If I try it from a command line

Unhandled exception. System.TypeInitializationException: The type initializer for '<Module>' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'WinRT.ActivationFactory`1' threw an exception.
 ---> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName)
   at WinRT.ActivationFactory`1..ctor()
   at WinRT.ActivationFactory`1..cctor()
   --- End of inner exception stack trace ---
   at WinRT.ActivationFactory`1.ActivateInstance[I]()
   at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentInitializeOptions..ctor()
   at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.get_Options() in C:\Users\saa\.nuget\packages\microsoft.windowsappsdk\1.3.230724000\include\DeploymentManagerAutoInitializer.cs:line 44
   at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.AccessWindowsAppSDK() in C:\Users\saa\.nuget\packages\microsoft.windowsappsdk\1.3.230724000\include\DeploymentManagerAutoInitializer.cs:line 30
   at .cctor()
   --- End of inner exception stack trace ---

However - if I create a brand new MAUI project in VS and attempt to run it on Windows - it works just fine.....

Any ideas of what to look for?

@markgr
Copy link
Author

markgr commented Jan 2, 2024

I should note that it all works on Android on my machine

I'm quite willing to accept that it's my machine somehow - but nothing obvious in Event Viewer etc - the one thing that I might have done was install DotNet 8.0 outside of VS - but even if I do the whole build through the Terminal only I still get the same result....

@markgr
Copy link
Author

markgr commented Jan 2, 2024

If I try from command line

PS C:\temp\maui\maui-samples\8.0\Tutorials\CreateNetMauiApp\step1> dotnet run -f:net8.0-windows10.0.19041.0
The launch profile "(Default)" could not be applied.
A usable launch profile could not be located.
Unhandled exception: System.ComponentModel.Win32Exception (31): An error occurred trying to start process 'C:\temp\maui\maui-samples\8.0\Tutorials\CreateNetMauiApp\step1\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\Notes.exe' with working directory 'C:\temp\maui\maui-samples\8.0\Tutorials\CreateNetMauiApp\step1'. A device attached to the system is not functioning.
   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.Invoke(ParseResult parseResult)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant