BennoDual
BennoDual

Reputation: 6259

Visual Studio 2012 shows xaml errors which are no errors

I do for example for a window:

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

This is working great and there are no Errors in Visual Studio 2010. Now, in Visual Studio 2012 I see the error

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

in the errorlist. But the Prayon.ico is in the Assembly Prayon.Common.Images which is correct referenced.

Why is Visual Studio 2012 reporting this as an error?

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

Upvotes: 4

Views: 822

Answers (1)

AltF4_
AltF4_

Reputation: 2460

Im pretty sure you are referencing the image in a funny way , shouldnt be more like this ?

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

or more precisely this

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

You can find out more about WPF pack URIs here: http://msdn.microsoft.com/en-us/library/aa970069.aspx

Upvotes: 2

Related Questions