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

Exception trying to build #5

Open
guilhermeolisi opened this issue Dec 15, 2022 · 4 comments
Open

Exception trying to build #5

guilhermeolisi opened this issue Dec 15, 2022 · 4 comments

Comments

@guilhermeolisi
Copy link

Hi,

I cloned your project and tried to build it in VS 2022 but got an exception. Can you help me to resolve this? I don't understand this problem.
Thanks

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'NamespaceInfo:/App.xaml' threw an exception.
Source=Avalonia.IconPacks
StackTrace:
at Avalonia.IconPacks.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Users\guilh\Documents\Acadêmico\VisualStudio\AvaloniaIconPacks\src\Avalonia.IconPacks\App.xaml:line 1
at Avalonia.IconPacks.App.!XamlIlPopulateTrampoline(App )
at Avalonia.IconPacks.App.Initialize() in C:\Users\guilh\Documents\Acadêmico\VisualStudio\AvaloniaIconPacks\src\Avalonia.IconPacks\App.xaml.cs:line 12
at Avalonia.Controls.AppBuilderBase`1.Setup()
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at Avalonia.IconPacks.Program.Main(String[] args) in C:\Users\guilh\Documents\Acadêmico\VisualStudio\AvaloniaIconPacks\src\Avalonia.IconPacks\Program.cs:line 19

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
BadImageFormatException: No string associated with token. The format of the file 'C:\Users\guilh\Documents\Acadêmico\VisualStudio\AvaloniaIconPacks\src\Avalonia.IconPacks\bin\x64\Debug\net6.0\Avalonia.IconPacks.dll' is invalid.

@devel0
Copy link

devel0 commented Jan 9, 2023

I got the same error (linux) and I was able to solve by issueing the cmd used in the workflow

dotnet publish ./src/Avalonia.IconPacks/Avalonia.IconPacks.csproj -r linux-x64 --self-contained -c Release -f net6.0 /p:PublishTrimmed=true /p:PublishLinux=True

then

cd src/Avalonia.IconPacks/bin/Release/net6.0/linux-x64/publish/
./Avalonia.IconPacks

@guilhermeolisi
Copy link
Author

I got the same error (linux) and I was able to solve by issueing the cmd used in the workflow

dotnet publish ./src/Avalonia.IconPacks/Avalonia.IconPacks.csproj -r linux-x64 --self-contained -c Release -f net6.0 /p:PublishTrimmed=true /p:PublishLinux=True

then

cd src/Avalonia.IconPacks/bin/Release/net6.0/linux-x64/publish/
./Avalonia.IconPacks

Thanks, I will try this in my Windows system.

@devel0
Copy link

devel0 commented Feb 8, 2023

the corresponding in window from workflow should be

dotnet publish ./src/Avalonia.IconPacks/Avalonia.IconPacks.csproj -r win-x64 --self-contained -c Release -f net6.0 /p:PublishTrimmed=true  /p:PublishWin=True

then

cd src/Avalonia.IconPacks/bin/Release/net6.0/win-x64/publish/
./Avalonia.IconPacks

@ahopper
Copy link
Owner

ahopper commented Feb 9, 2023

sorry I missed this issue, notifications were being sent to spam.
The publishWin publishOsx and publishLinux switches shrink the app a little as it avoids including some xplat code. I believe this wont be needed in Avalonia 11.0

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

3 participants