Visual Studio 2012 shows xaml errors that are not errors

For example, for a window:

Icon="/Prayon.Common.Images;component/Application/Prayon.ico" 

This works fine and there are no errors in Visual Studio 2010. Now, in Visual Studio 2012, I see an error

 Could not find a part of the path 'C:\Prayon.Common.Images;component\Application\Prayon.ico'. 

in the error list. But Prayon.ico is in Assembly Prayon.Common.Images , which is correctly specified.

Why is Visual Studio 2012 reporting this as an error?

I can compile and run the project without any problems. There are only a lot of error messages in ErrorList VS2012, and this makes it difficult to get "real" errors.

+4
source share
1 answer

I'm sure that you are boldly referring to the image. Shouldn't it be more like this?

 pack://application:,,,/Resources/Prayon.png" 

or rather it is

 <Image Source="/ClassLibraryName;Component/images/myimage.png"/> 

Here you can learn more about the WPF package URI: http://msdn.microsoft.com/en-us/library/aa970069.aspx

+2
source

Source: https://habr.com/ru/post/1434452/


All Articles