-
Notifications
You must be signed in to change notification settings - Fork 108
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
[BUG] AIDevGallery Runtime Error at startup (Class Not Registered) #276
Comments
AI Dev Gallery is a packaged application (MSIX), and it does not support running the exe from the bin folder manually. It needs App identity, so it needs to be installed from the MSIX itself. |
Thanks Alex. Yes. We are running the EXE from the bin folder as-is. That must be the bug. Let me try and confirm. So do all C# WindowsAppSDK samples (like ChatAppGenAI etc) needs to be MSIX? Are these C# samples that can run as standard desktop apps (exe)? Thanks for the prompt response. |
Running as an MSIX is particular to the AI Dev Gallery itself, since we use APIs that require App Identity. Just for testing purposes, I just exported the Chat Sample with Phi 4 and it worked fine as non-packaged. Yay! 🥳 In order to do this, all you need to do is add this property to your exported csproj: <WindowsPackageType>None</WindowsPackageType> And change the deployment setting in the dropdown, in Visual Studio, when deploying: Here is a link to the documentation: |
Thanks Alex, Let us try this. You have been very helpful! |
BTW - If we do create a MSIX pkg, does it have to be signed (even if we use our company valid SPC)? The unsigned MISX failed installed and reported that the package has to be signed. When we tried the "unpackaged" format and launch the EXE directly, it now shows an error that the system is missing: Windows Runtime Version 1.5 (MSIX package version >= 5001.119.156.0) and asks us to install WindowsAppSDK - which is already installed. We tried reinstalling it again from the link but still the same thing. |
You would need to make sure that the WinAppSDK is installed. Docs: If you want to make it completely installable by itself, you could do self-containment (both WinAppSDK and .Net). <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> Docs: Same for .Net (but not as simple to keep the binary size small): I would not recommend the self-contained route if not absolutely necessary, since patches (security) to the WinAppSDK would not be possible without recompiling and redistributing your app. |
Hmm. That is strange then because the .NET Core version and WinndowsAppSDK that we have compiled with are installed on that system. Let us check everything again. Thanks again for your prompt responses :) |
Describe the bug
Able to download and compile the AIDevGallery application. When I run this the application it crashes with following error:
Application: AIDevGallery.exe
CoreCLR Version: 9.0.225.6610
.NET Version: 9.0.2
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.ActivationFactory.Get(String typeName, Guid iid)
at Microsoft.Windows.AppLifecycle.AppInstance.get__objRef_global__Microsoft_Windows_AppLifecycle_IAppInstanceStatics()
at Microsoft.Windows.AppLifecycle.AppInstance.GetCurrent()
at AIDevGallery.Program.DecideRedirection() in D:\Proj\ai-dev-gallery-main\AIDevGallery\Program.cs:line 48
at AIDevGallery.Program.Main() in D:\Proj\ai-dev-gallery-main\AIDevGallery\Program.cs:line 29
NOTE: When I downloaded the same "precompiled" app from Windows Store on the same test system it runs fine.
Test system has WindowsAppSdk [1.7 Experimental3 (1.7.250127003-experimental3)] X64 installed and has DEVELOPER mode enabled.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Hoping to see the APP UI
Screenshots
Please complete the following information:
Additional context
Not sure if the application version that we compiled ourselves need to be registered on the test system before it is allowed to run!
The text was updated successfully, but these errors were encountered: