Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Wpf Browser Application   and resources problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marek Kolesar - 11 Feb 2008 21:37 GMT
Hi ...

i develop now Wpf Browser Application  ... now i have very ease web app ...

i have only 1 page wit h 2 buttons ....
in resources added file languages.xml
resources acces modifier set to public

and now my problem ....

how to load this resource ?

i try a few function .. but everytime functions return null

           System.IO.Stream stream =
this.GetType().Assembly.GetManifestResourceStream("MyApp.Languages.xml");
               System.IO.Stream stream1 =
this.GetType().Assembly.GetManifestResourceStream("../Languages.xml");
      System.IO.Stream stream2 =
Application.ResourceAssembly.GetManifestResourceStream("Languages.xml");

+ everytime return null ... without exception ...

any idea whats wrong ?
Nicholas Paldino [.NET/C# MVP] - 11 Feb 2008 22:02 GMT
Marek,

   By resource, what do you mean?  I ask because WPF allows for embedding
resources within XAML files, and you could actually embed XML in the XAML
file as a resource.

   Or is this a resource file that you are adding to the project, and then
acessing that?  If this is the case, then the designer should have added a
type-safe wrapper to access the resource through.

   Or are you just adding the file to the project and setting the Build
Action to "Embedded Resource"?  If this is the case, then the first call
should work, assuming that the default namespace for your app is "MyApp".
You need to check the properties for the project and on the Application tab,
look at the "Default Namespace" as that is what needs to preceed
"Langages.xml".

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi ...
>
[quoted text clipped - 21 lines]
>
> any idea whats wrong ?
Marek Kolesar - 11 Feb 2008 22:43 GMT
tx ...

i put file into resources ( resources is embedeed resources)  ( click on
resources -> add reseurce ..and inset file ..)

i try debug ... all data from languages .xml is in *.deploy file ...

but .. Resources.Count  = 0;
then i try App.Resources ... same ... not here ...
+ i try locate this resource in debuger ... i read all property ... and
never get my resource .... everytime return null

+ namespaces have corect

or if u have link for sample how to use resources in Wpf Browser Application
... then i try compare whats wrong ..

----------------------------------------------------------------------------------------------------------------------------------

> Marek,
>
[quoted text clipped - 38 lines]
>>
>> any idea whats wrong ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.