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

dotnet-mage shows: Internal error ... 'Microsoft.Win32.Registry' threw an exception. #124

Open
TheCollegedude opened this issue Jul 13, 2021 · 10 comments

Comments

@TheCollegedude
Copy link

When I run dotnet-mage -update Application.application it shows:

Internal error, please try again. The type initializer for 'Microsoft.Win32.Registry' threw an exception.

Version 5.0.301 on Ubuntu 20.4 (x86_64)

@TheCollegedude
Copy link
Author

The problem comes from calling Utilities.Misc.GetRegisteredOrganization, it does not work on Linux.
This could just return an empty string when the OS is not Windows.
A workaround is to append -Publish "X" as command line argument

@NikolaMilosavljevic
Copy link
Member

[Triage] @TheCollegedude can you share some details about your end to end scenarios? ClickOnce application can only be installed on Windows as Linux does not have ClickOnce runtime components.

dotnet-mage is platform agnostic, but it was built from an old Windows-only tool Mage, to run on .NET 5. Some code might not work correctly on non-Windows platforms.

@IGx89
Copy link

IGx89 commented Aug 12, 2021

@NikolaMilosavljevic Just ran into this error myself and I can add a scenario: we're calling this in GitHub Actions where Linux build agents are half the cost of Windows ones, so we try to run as many workflows on Linux agents as possible.

If this does only support Windows, it would be good to call it out in the readme -- usually the assumption is that .NET Core apps are cross-platform unless otherwise noted.

@NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic Just ran into this error myself and I can add a scenario: we're calling this in GitHub Actions where Linux build agents are half the cost of Windows ones, so we try to run as many workflows on Linux agents as possible.

If this does only support Windows, it would be good to call it out in the readme -- usually the assumption is that .NET Core apps are cross-platform unless otherwise noted.

Agreed - we should document this.

@NikolaMilosavljevic
Copy link
Member

The problem comes from calling Utilities.Misc.GetRegisteredOrganization, it does not work on Linux.
This could just return an empty string when the OS is not Windows.
A workaround is to append -Publish "X" as command line argument

A fix might be possible, for this particular scenario.

Some other known issues are signing, which is not supported on Linux, and wouldn't be easy to enable.

@NikolaMilosavljevic
Copy link
Member

I've updated readme to clarify that dotnet-mage is fully supported on Windows. We are gathering feedback about scenarios for usage of the tool on Linux agents.

This and similar issues are very valuable for planning future work.

@IGx89
Copy link

IGx89 commented Mar 23, 2022

FYI, I haven't confirmed myself, but #171 appears to have fixed this issue in v6.0.1 (by way of #176).

@pjmagee
Copy link

pjmagee commented Jun 22, 2024

And now im only finding this after hours.... Why would we not target windows only and even bother mentioning .NET5 + if its not built specifically to be Windows only. I thought mage was the xplat solution to not having to use msbuild clickonce which only worked with .net framework version of msbuild to do the installer stuff. And now i get so far to write some pipeline stuff which installs the tool on linux, since its not published to only work on Windows...

For now, I am running some commands on a windows machine in Github Job, and then taking artifacts from that to then pass onto linux agent for now, I think this is my compromise :)

@pjmagee
Copy link

pjmagee commented Jun 22, 2024

I've updated readme to clarify that dotnet-mage is fully supported on Windows. We are gathering feedback about scenarios for usage of the tool on Linux agents.

This and similar issues are very valuable for planning future work.

This should have said mage is only windows supported, and dont even think about running it on linux containers or linux build agents. "Fully windows supported" wasnt clear for me. Nevermind.

@pjmagee
Copy link

pjmagee commented Jun 22, 2024

When I run dotnet-mage -update Application.application it shows:

Internal error, please try again. The type initializer for 'Microsoft.Win32.Registry' threw an exception.

Version 5.0.301 on Ubuntu 20.4 (x86_64)

Did you end up finding another solution to doing OneClick deployment for Windows based .NET5+ WPF Apps? I've been struggling for hours since the documentation is scattered all over and there doesnt seem to be one good way of doing this other than having to use an IDE to manually deploy... which is not what I want to be doing. I want GitOps, builds and reelases via git tag events etc. :(

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

No branches or pull requests

5 participants