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

Relative uri without base url #747

Open
microhobby opened this issue May 27, 2020 · 0 comments
Open

Relative uri without base url #747

microhobby opened this issue May 27, 2020 · 0 comments

Comments

@microhobby
Copy link

Trying to open MainWindowView that use a icon that is on Assets, so I get this error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Relative uri /Assets/avalonia-logo.ico without base url
   at Avalonia.Shared.PlatformSupport.AssetLoader.EnsureAbsolute(Uri uri, Uri baseUri)
   at Avalonia.Shared.PlatformSupport.AssetLoader.GetAsset(Uri uri, Uri baseUri)
   at Avalonia.Shared.PlatformSupport.AssetLoader.OpenAndGetAssembly(Uri uri, Uri baseUri)
   at Avalonia.Shared.PlatformSupport.AssetLoader.Open(Uri uri, Uri baseUri)
   at Avalonia.Markup.Xaml.Converters.IconTypeConverter.CreateIconFromPath(ITypeDescriptorContext context, String s)
   at Avalonia.Markup.Xaml.Converters.IconTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at Builder_56f03198738d4c65a67ab50925796d51_.__AvaloniaXamlIlPopulate(IServiceProvider , MainWindow )
   at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.<>c__DisplayClass11_0.<LoadOrPopulate>b__0(Object target)
   at AvaloniaNETCoreMVVMApp.Views.MainWindow.!XamlIlPopulateTrampoline(MainWindow )
   at AvaloniaNETCoreMVVMApp.Views.MainWindow.InitializeComponent() in C:\Users\mpro3\AvalonStudio\Projects\AvaloniaNETCoreMVVMApp\AvaloniaNETCoreMVVMApp\Views\MainWindow.xaml.cs:line 16
   at AvaloniaNETCoreMVVMApp.Views.MainWindow..ctor() in C:\Users\mpro3\AvalonStudio\Projects\AvaloniaNETCoreMVVMApp\AvaloniaNETCoreMVVMApp\Views\MainWindow.xaml.cs:line 11
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type)
   at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadOrPopulate(Type created, Object rootInstance)
   at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSreCore(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
   at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSre(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
   at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri, Boolean isDesignMode)
   at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri)
   at Avalonia.DesignerSupport.DesignWindowLoader.LoadDesignerWindow(String xaml, String assemblyPath, String xamlFileProjectPath)
   at Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.<>c__DisplayClass17_0.<OnTransportMessage>b__0()

The same occurs for the use of images inside Assets (I think the editor is not using the project path but his own executable)

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

1 participant