deployment-tools icon indicating copy to clipboard operation
deployment-tools copied to clipboard

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

Open TheCollegedude opened this issue 4 years ago • 10 comments

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 avatar Jul 13 '21 10:07 TheCollegedude

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

TheCollegedude avatar Jul 13 '21 10:07 TheCollegedude

[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.

NikolaMilosavljevic avatar Jul 28 '21 20:07 NikolaMilosavljevic

@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.

IGx89 avatar Aug 12 '21 14:08 IGx89

@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 avatar Aug 23 '21 18:08 NikolaMilosavljevic

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 avatar Aug 23 '21 18:08 NikolaMilosavljevic

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.

NikolaMilosavljevic avatar Aug 30 '21 16:08 NikolaMilosavljevic

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

IGx89 avatar Mar 23 '22 01:03 IGx89

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 avatar Jun 22 '24 16:06 pjmagee

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 avatar Jun 22 '24 16:06 pjmagee

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. :(

pjmagee avatar Jun 22 '24 16:06 pjmagee