![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Resourcedictionary in dll; pack uri no longer working I have a dll that does some geometric conversions. For this I need some geometry templates that I put in a resourcedictionary. Whatever I did I could not get this resourcedictionary to load. Then I added the dictionary as content I could load it. I thought I could sort it out later and went on with my work. Now I got back to testing the resourcedictionary but now I cannot load it as content file. When I create the pack-uri I get an exception: "Invalid Uri. Because of a double point a connection was expected but the connection could not be analysed." (Something like that, I get the german version of this error). My Uri looks like this: pack://application:,,,/path/dictionary.xaml What could be wrong? I do not know of any relevant changes. Anyhow my changes in the app shouldn't affect the Uri-parser... |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: Resourcedictionary in dll; pack uri no longer working I just tried using an absolute Uri for loading the resourcedictionary but got an InvalidOperationException ("Error at LoadFrom with the Uri '...' "). I tried a reinstall of the Visual Studio CTP Extensions, reinstall of ..Net3.0 is not possible as this is Vista. |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Resourcedictionary in dll; pack uri no longer working Hi, Ralf Ziller wrote: > I have a dll that does some geometric conversions. For this I need some > geometry templates that I put in a resourcedictionary. > Whatever I did I could not get this resourcedictionary to load. Then I added > the dictionary as content I could load it. I thought I could sort it out > later and went on with my work. > Now I got back to testing the resourcedictionary but now I cannot load it as > content file. When I create the pack-uri I get an exception: "Invalid Uri. > Because of a double point a connection was expected but the connection could > not be analysed." (Something like that, I get the german version of this > error). > My Uri looks like this: > pack://application:,,,/path/dictionary.xaml > What could be wrong? I do not know of any relevant changes. Anyhow my > changes in the app shouldn't affect the Uri-parser... From the title of your post it sounds as if the dictionary.xaml is located in an external DLL. In this case, the pack URI should be: pack://application:,,,/externalDllName;component/path/dictionary.xaml For more info about pack URIs, check this page: http://msdn2.microsoft.com/en-us/library/aa970069.aspx HTH, Laurent -- Laurent Bugnion [MVP ASP.NET] Software engineering, Blog: http://www.galasoft.ch PhotoAlbum: http://www.galasoft.ch/pictures Support children in Calcutta: http://www.calcutta-espoir.ch |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Resourcedictionary in dll; pack uri no longer working "Laurent Bugnion, MVP" wrote: > > From the title of your post it sounds as if the dictionary.xaml is > located in an external DLL. No, the project is a dll which does the conversions and should be used from applications and perhaps websites. The dictionary should be inside this dll and only be used inside this dll. Sorry for this misleading formulation. Ralf |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: Resourcedictionary in dll; pack uri no longer working I have a correct translation of the error now: "Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed." If I use a relative URI as stated in http://msdn2.microsoft.com/en-us/library/aa970069.aspx I get another error: "Unknown URI prefix" |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: Resourcedictionary in dll; pack uri no longer working Hi, Ralf Ziller wrote: > I have a correct translation of the error now: > "Invalid URI: A port was expected because of there is a colon (':') present > but the port could not be parsed." > > If I use a relative URI as stated in > http://msdn2.microsoft.com/en-us/library/aa970069.aspx > I get another error: > "Unknown URI prefix" I made a quick test. Here is the structure in my Solution: Solution - myFolder1 - myFolder2 - Dictionary1.xaml - Window1.xaml If I want to include Dictionary1.xaml in my Window1's resources, I use either the short form: <Window.Resources> <ResourceDictionary Source="myFolder1/myFolder2/Dictionary1.xaml"/> </Window.Resources> or the long (though the long form has no advantage for the "application" authority: <Window.Resources> <ResourceDictionary Source="pack://application:,,,/myFolder1/myFolder2/Dictionary1.xaml"/> </Window.Resources> (sorry for the wrapping) If you tried this, and it didn't work, try to make the smallest possible repro of this problem, and zip it and email it to me if you want, I'll look at it. Greetings, Laurent -- Laurent Bugnion [MVP ASP.NET] Software engineering, Blog: http://www.galasoft.ch PhotoAlbum: http://www.galasoft.ch/pictures Support children in Calcutta: http://www.calcutta-espoir.ch |
My System Specs![]() |
| | #7 (permalink) |
| Guest | Re: Resourcedictionary in dll; pack uri no longer working Hello, this works for me, too. But I needed to access the Resourcedictionary from code: ResourceDictionary d = new ResourceDictionary(); d.Source=new Uri("Dictionary.xaml"); I found this in several examples but it does not work. Now I take a Custom UserControl which holds the resources. That works perfect. Thanks for your answers Ralf "Laurent Bugnion, MVP" wrote: > > <Window.Resources> > <ResourceDictionary > Source="myFolder1/myFolder2/Dictionary1.xaml"/> > </Window.Resources> |
My System Specs![]() |
| | #8 (permalink) |
| Guest | Programatically merging a ResourceDictionary. I had the same problem. This fixed it: ResourceDictionary d = new ResourceDictionary(); d.Source=new Uri("<AssemblyName>;component/Dictionary.xaml", UriKind.Relative); (replace <AssemblyName> with the real name of your assembly) BTW, subfolders are possible, too. For example, if the assembly were named 'Common' and the folder structure in Solution Explorer were Common - BaseClasses - Gui - Dictionary.xaml , you would have initialized the source like this: d.Source = new Uri("Common;component/BaseClasses/Gui/Dictionary.xaml", UriKind.Relative); |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Service Pack 1 - how much longer? | Vista General | 29 | 06-29-2008 12:18 PM | |
| USB no longer working | mrinventions | General Discussion | 0 | 03-01-2008 11:01 AM |
| wmp and wmc no longer working | snewton62 | Vista music pictures video | 4 | 05-04-2007 03:28 AM |
| USB no longer working | darthsabre | Vista hardware & devices | 1 | 03-09-2007 07:57 PM |
| ResourceDictionary bug | Guillaume | Avalon | 1 | 03-22-2006 09:49 AM |