You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated our avalonia application from 11.0.11 to 11.1.3. The application builds and runs properly from IDE or dotnet run. But if I publish the app self contained for windows at runtime the following error occurs:
System.ArgumentException: An item with the same key has already been added. Key: /Assets/Icons.axaml
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](List`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Avalonia.Platform.Internal.AssemblyDescriptor..ctor(Assembly assembly)
at Avalonia.Platform.StandardAssetLoader..ctor(IAssemblyDescriptorResolver resolver, Assembly assembly)
at Avalonia.Platform.StandardAssetLoader..ctor(Assembly assembly)
at Avalonia.Platform.StandardRuntimePlatformServices.Register(Assembly assembly)
at Avalonia.AppBuilder.<UseStandardRuntimePlatformSubsystem>b__68_0()
at Avalonia.AppBuilder.SetupUnsafe()
at Avalonia.AppBuilder.Setup()
at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
at Company.Application1.App.Program.Main(String[] args) in C:\Users\peter.friedland\source\repos\HyperPlan-App\source\HyperPlan.App\Program.cs:line 27
Publish upgraded app from 11.0.11 to 11.1.3 by updating avalonia nuget packages
publish for windows
Expected behavior
App runs and does not embed resources twice, so that published apps can be used again.
Avalonia version
11.1.3
OS
Windows
Additional context
I have debugged it from sources and I can really see that the resource named is embedded twice in the binary stream.
I have already performed the following changes with in between removed obj folders to ensure proper rebuild:
Remove trimming from project file and nuke build
remove <AvaloniaResource Include="Assets\**" /> from project, which changes the error to that the Resource app is not found any more and it should have an x:class or defined as avaloniaResource, which is weird because the app.xaml is not in the folder.
I am looking forward for some hints what I can do instead of just tinkering around and hoping that it works again.
The text was updated successfully, but these errors were encountered:
thank you for your help. I give it a try but I am not really sure that this will help guess you have been misslead by the name: Icons.axaml. its a resource dictionary containing geometrydrawings.
Describe the bug
I have updated our avalonia application from 11.0.11 to 11.1.3. The application builds and runs properly from IDE or dotnet run. But if I publish the app self contained for windows at runtime the following error occurs:
Here is the project file of the avalonia app:
To Reproduce
Expected behavior
App runs and does not embed resources twice, so that published apps can be used again.
Avalonia version
11.1.3
OS
Windows
Additional context
I have debugged it from sources and I can really see that the resource named is embedded twice in the binary stream.
I have already performed the following changes with in between removed obj folders to ensure proper rebuild:
<AvaloniaResource Include="Assets\**" />
from project, which changes the error to that the Resource app is not found any more and it should have an x:class or defined as avaloniaResource, which is weird because the app.xaml is not in the folder.I am looking forward for some hints what I can do instead of just tinkering around and hoping that it works again.
The text was updated successfully, but these errors were encountered: