Reputation: 419
I am using Visual Studio 2010 with Visual Basic and WPF. I've this one line of XAML code in my program throughout a 2-year development process that sets a background image for the main window. It's always worked perfectly with absolutely no problems:
<ImageBrush ImageSource="/MyProgram;component/Images/background.jpg"
Stretch="UniformToFill" TileMode="None" />
Now, I've gotten a new computer and copied over my VS2010 projects directory. All of a sudden, I'm getting this error in the design view:
Invalid URI: The Authority/Host could not be parsed
The Design view is completely frozen and won't let me do anything. However, the program still compiles just fine, background image and all. But obviously I can't continue my work on the program without the Design view. How can I fix this problem?
Incidentally, in case someone asks, this program has not been changed AT ALL in between working on my old computer and not working on my new computer. However, the version of VS2010 has changed from Premium to Ultimate, if that makes a difference.
SOME ADDITIONAL INFORMATION: I deleted the offending line of XAML code and attempted to re-add the background image to the window via the Design view (the Properties editor). Everything works fine so long as the background is set to a solid color, but as soon as I click on the button to set an image as the background, before it even lets me pick an image, I get an error that says the property's value is not valid, referencing the same Invalid URI error as before.
Upvotes: 0
Views: 10434
Reputation: 61
1) Map a drive to your share like S:\SERVEUR\TEST
2) Open your file from this drive and not from \SERVEUR\TEST
3) Put the map path to your source like "image source="S:\SERVEUR\TEST""
Upvotes: 0
Reputation: 412
Note: this also happens with the <Image>
control (without even specifying a source). Eg:
<Image Margin="60,72,71,198" Name="imageResults" Stretch="Uniform" Visibility="Visible" />
Moving it to a local drive got it working.
Upvotes: 0
Reputation: 5114
This problem usually happens when your code/image/file is on a shared network drive.
Is this your case?
If so, just copy all files to your local drive and it should work.
Upvotes: 4