Connecting Tech Pros Worldwide Help | Site Map

resources in vs.net

Marcus Ahlberg
Guest
 
Posts: n/a
#1: Nov 15 '05
I've been coding a C# project in "pure code" and I would now want to import
it into VS.net. I have created a project and imported all sourcefiles and
it's compiling without problems, except for the resources. Before, I built
the program using a batchfile and linked the resources with the
"/resource:MainFrame.resX" option. Then I loaded them with this code:

Assembly myAssembly = Assembly.GetAssembly(this.GetType());
Stream resXStream =
myAssembly.GetManifestResourceStream("MainFrame.re sX");
ResXResourceSet resX = new ResXResourceSet(resXStream);

The problem is the way VS manages resources. It can't find MainFrame.resX
and i get an error because resXStream = null. I've tried to change the
"Build Action" -property of the files, but it doesn't seem to make any
difference. It's the same problem with images. Is there any way to change
the way the resources is included? I don't want to rewrite the whole program
because of incompability between VS and the compiler.


Marcus Ahlberg
Guest
 
Posts: n/a
#2: Nov 15 '05

re: resources in vs.net


I've added the files to the project and tried different settings for Build
Action. I won't be using the WinForm-designer since my forms are handmade. I
just want to edit my code in vs and use the build function.
This problem applies to all my images too, and I just want my resources to
be included the same way that the "/resource:image.png" option does.
Is there any way to send this option to the compiler manualy in VS?
Thanks for trying to help me!

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...[color=blue]
> Marcus,
> Did you include MainFrame.ResX in your project?
>
> Did you set the Build Action (in the properties window) for the above file
> to Embedded Resource?
>
> Watch namespaces. Use Reflector to verify the names of the resources in[/color]
the[color=blue]
> assembly.
>
> Note: If you have a form names MainFrame, VS.NET will create a
> MainFrame.Resx for you. Use Show All Files in solution explorer.
>
> Hope this helps
> Jay
>
> "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...[color=green]
> > I've been coding a C# project in "pure code" and I would now want to[/color]
> import[color=green]
> > it into VS.net. I have created a project and imported all sourcefiles[/color][/color]
and[color=blue][color=green]
> > it's compiling without problems, except for the resources. Before, I[/color][/color]
built[color=blue][color=green]
> > the program using a batchfile and linked the resources with the
> > "/resource:MainFrame.resX" option. Then I loaded them with this code:
> >
> > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > Stream resXStream =
> > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > ResXResourceSet resX = new ResXResourceSet(resXStream);
> >
> > The problem is the way VS manages resources. It can't find[/color][/color]
MainFrame.resX[color=blue][color=green]
> > and i get an error because resXStream = null. I've tried to change the
> > "Build Action" -property of the files, but it doesn't seem to make any
> > difference. It's the same problem with images. Is there any way to[/color][/color]
change[color=blue][color=green]
> > the way the resources is included? I don't want to rewrite the whole[/color]
> program[color=green]
> > because of incompability between VS and the compiler.
> >
> >[/color]
>
>[/color]


Jay B. Harlow [MVP - Outlook]
Guest
 
Posts: n/a
#3: Nov 15 '05

re: resources in vs.net


Marcus,
That's fine, you do not need to use the WinForm Designer with VS.NET.

My question still stands: Did you add the MainFrame.resx to your project,
and set the build action to Embedded Resource.

As it sounds like you want to embed the resource in the exactable, to do
this with VS.NET, you add the resx file to your project, and set the build
action to embedded resource. Did you do that?

If you have done the above, and it is still not working, I suspect the
namespace of your resource does not match the namespace you are trying to
use to retrieve it. You can use Reflector to verify the namespace. See
http://www.aisto.com/roeder/dotnet/ for Reflector.
[color=blue]
> Is there any way to send this option to the compiler manually in VS?[/color]
Yes there is! ;-)

Build Action = Embedded Resource. Works for .resx files and any other file
type you give it.

Hope this helps
Jay

"Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
news:OPM$iaDVDHA.1600@TK2MSFTNGP09.phx.gbl...[color=blue]
> I've added the files to the project and tried different settings for Build
> Action. I won't be using the WinForm-designer since my forms are handmade.[/color]
I[color=blue]
> just want to edit my code in vs and use the build function.
> This problem applies to all my images too, and I just want my resources to
> be included the same way that the "/resource:image.png" option does.
> Is there any way to send this option to the compiler manualy in VS?
> Thanks for trying to help me!
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...[color=green]
> > Marcus,
> > Did you include MainFrame.ResX in your project?
> >
> > Did you set the Build Action (in the properties window) for the above[/color][/color]
file[color=blue][color=green]
> > to Embedded Resource?
> >
> > Watch namespaces. Use Reflector to verify the names of the resources in[/color]
> the[color=green]
> > assembly.
> >
> > Note: If you have a form names MainFrame, VS.NET will create a
> > MainFrame.Resx for you. Use Show All Files in solution explorer.
> >
> > Hope this helps
> > Jay
> >
> > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > I've been coding a C# project in "pure code" and I would now want to[/color]
> > import[color=darkred]
> > > it into VS.net. I have created a project and imported all sourcefiles[/color][/color]
> and[color=green][color=darkred]
> > > it's compiling without problems, except for the resources. Before, I[/color][/color]
> built[color=green][color=darkred]
> > > the program using a batchfile and linked the resources with the
> > > "/resource:MainFrame.resX" option. Then I loaded them with this code:
> > >
> > > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > > Stream resXStream =
> > > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > > ResXResourceSet resX = new ResXResourceSet(resXStream);
> > >
> > > The problem is the way VS manages resources. It can't find[/color][/color]
> MainFrame.resX[color=green][color=darkred]
> > > and i get an error because resXStream = null. I've tried to change the
> > > "Build Action" -property of the files, but it doesn't seem to make any
> > > difference. It's the same problem with images. Is there any way to[/color][/color]
> change[color=green][color=darkred]
> > > the way the resources is included? I don't want to rewrite the whole[/color]
> > program[color=darkred]
> > > because of incompability between VS and the compiler.
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Marcus Ahlberg
Guest
 
Posts: n/a
#4: Nov 15 '05

re: resources in vs.net


Yes I set the Build action to Embeded Resource, but it is not exactly the
same thing.

For the images, it seems like they are included the same way, but they are
all put in a namespace like "Marcusoft.TextWrite.res.CommandIcons.bmp" but I
want them to exist outside the namespace like "CommandIcons.bmp". Do you
know how to specify witch namespace to put them in?

I called "myAssembly.GetManifestResourceNames()" and I found the name
"Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid resX
input. It seems like VS is doing something with the resX-files.

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
meddelandet news:uBbuawFVDHA.2508@TK2MSFTNGP12.phx.gbl...[color=blue]
> Marcus,
> That's fine, you do not need to use the WinForm Designer with VS.NET.
>
> My question still stands: Did you add the MainFrame.resx to your project,
> and set the build action to Embedded Resource.
>
> As it sounds like you want to embed the resource in the exactable, to do
> this with VS.NET, you add the resx file to your project, and set the build
> action to embedded resource. Did you do that?
>
> If you have done the above, and it is still not working, I suspect the
> namespace of your resource does not match the namespace you are trying to
> use to retrieve it. You can use Reflector to verify the namespace. See
> http://www.aisto.com/roeder/dotnet/ for Reflector.
>[color=green]
> > Is there any way to send this option to the compiler manually in VS?[/color]
> Yes there is! ;-)
>
> Build Action = Embedded Resource. Works for .resx files and any other file
> type you give it.
>
> Hope this helps
> Jay
>
> "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> news:OPM$iaDVDHA.1600@TK2MSFTNGP09.phx.gbl...[color=green]
> > I've added the files to the project and tried different settings for[/color][/color]
Build[color=blue][color=green]
> > Action. I won't be using the WinForm-designer since my forms are[/color][/color]
handmade.[color=blue]
> I[color=green]
> > just want to edit my code in vs and use the build function.
> > This problem applies to all my images too, and I just want my resources[/color][/color]
to[color=blue][color=green]
> > be included the same way that the "/resource:image.png" option does.
> > Is there any way to send this option to the compiler manualy in VS?
> > Thanks for trying to help me!
> >
> > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > Marcus,
> > > Did you include MainFrame.ResX in your project?
> > >
> > > Did you set the Build Action (in the properties window) for the above[/color][/color]
> file[color=green][color=darkred]
> > > to Embedded Resource?
> > >
> > > Watch namespaces. Use Reflector to verify the names of the resources[/color][/color][/color]
in[color=blue][color=green]
> > the[color=darkred]
> > > assembly.
> > >
> > > Note: If you have a form names MainFrame, VS.NET will create a
> > > MainFrame.Resx for you. Use Show All Files in solution explorer.
> > >
> > > Hope this helps
> > > Jay
> > >
> > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...
> > > > I've been coding a C# project in "pure code" and I would now want to
> > > import
> > > > it into VS.net. I have created a project and imported all[/color][/color][/color]
sourcefiles[color=blue][color=green]
> > and[color=darkred]
> > > > it's compiling without problems, except for the resources. Before, I[/color]
> > built[color=darkred]
> > > > the program using a batchfile and linked the resources with the
> > > > "/resource:MainFrame.resX" option. Then I loaded them with this[/color][/color][/color]
code:[color=blue][color=green][color=darkred]
> > > >
> > > > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > > > Stream resXStream =
> > > > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > > > ResXResourceSet resX = new ResXResourceSet(resXStream);
> > > >
> > > > The problem is the way VS manages resources. It can't find[/color]
> > MainFrame.resX[color=darkred]
> > > > and i get an error because resXStream = null. I've tried to change[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > "Build Action" -property of the files, but it doesn't seem to make[/color][/color][/color]
any[color=blue][color=green][color=darkred]
> > > > difference. It's the same problem with images. Is there any way to[/color]
> > change[color=darkred]
> > > > the way the resources is included? I don't want to rewrite the whole
> > > program
> > > > because of incompability between VS and the compiler.
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Jay B. Harlow [MVP - Outlook]
Guest
 
Posts: n/a
#5: Nov 15 '05

re: resources in vs.net


Marcus,[color=blue]
> Yes I set the Build action to Embeded Resource, but it is not exactly the
> same thing.[/color]
For bitmaps, other than namespace how is it different? As your found out,
..resx files are actually compiled and embedded as .resources.
[color=blue]
> Do you know how to specify witch namespace to put them in?[/color]
I do not know how to control the namespace that VS.NET uses when it includes
the resource. I wish I did.

The little bit of testing I have done with it, C# seems to behave better
about it, then VB.NET does. In that the namespaces that C# uses seem more
natural.
[color=blue]
> I called "myAssembly.GetManifestResourceNames()" and I found the name
> "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid resX
> input. It seems like VS is doing something with the resX-files.[/color]
VS.NET compiles your .resx files into .resource files, it then embeds the
..resource file into the assembly. You will need to change your code that
uses .resx to use .resource. The ResourceManager makes this rather easy.

http://msdn.microsoft.com/library/de...rcemanager.asp

Hope this helps
Jay

"Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
news:uX3vxqGVDHA.1172@TK2MSFTNGP11.phx.gbl...[color=blue]
> Yes I set the Build action to Embeded Resource, but it is not exactly the
> same thing.
>
> For the images, it seems like they are included the same way, but they are
> all put in a namespace like "Marcusoft.TextWrite.res.CommandIcons.bmp" but[/color]
I[color=blue]
> want them to exist outside the namespace like "CommandIcons.bmp". Do you
> know how to specify witch namespace to put them in?
>
> I called "myAssembly.GetManifestResourceNames()" and I found the name
> "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid resX
> input. It seems like VS is doing something with the resX-files.
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> meddelandet news:uBbuawFVDHA.2508@TK2MSFTNGP12.phx.gbl...[color=green]
> > Marcus,
> > That's fine, you do not need to use the WinForm Designer with VS.NET.
> >
> > My question still stands: Did you add the MainFrame.resx to your[/color][/color]
project,[color=blue][color=green]
> > and set the build action to Embedded Resource.
> >
> > As it sounds like you want to embed the resource in the exactable, to do
> > this with VS.NET, you add the resx file to your project, and set the[/color][/color]
build[color=blue][color=green]
> > action to embedded resource. Did you do that?
> >
> > If you have done the above, and it is still not working, I suspect the
> > namespace of your resource does not match the namespace you are trying[/color][/color]
to[color=blue][color=green]
> > use to retrieve it. You can use Reflector to verify the namespace. See
> > http://www.aisto.com/roeder/dotnet/ for Reflector.
> >[color=darkred]
> > > Is there any way to send this option to the compiler manually in VS?[/color]
> > Yes there is! ;-)
> >
> > Build Action = Embedded Resource. Works for .resx files and any other[/color][/color]
file[color=blue][color=green]
> > type you give it.
> >
> > Hope this helps
> > Jay
> >
> > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > news:OPM$iaDVDHA.1600@TK2MSFTNGP09.phx.gbl...[color=darkred]
> > > I've added the files to the project and tried different settings for[/color][/color]
> Build[color=green][color=darkred]
> > > Action. I won't be using the WinForm-designer since my forms are[/color][/color]
> handmade.[color=green]
> > I[color=darkred]
> > > just want to edit my code in vs and use the build function.
> > > This problem applies to all my images too, and I just want my[/color][/color][/color]
resources[color=blue]
> to[color=green][color=darkred]
> > > be included the same way that the "/resource:image.png" option does.
> > > Is there any way to send this option to the compiler manualy in VS?
> > > Thanks for trying to help me!
> > >
> > > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > > meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...
> > > > Marcus,
> > > > Did you include MainFrame.ResX in your project?
> > > >
> > > > Did you set the Build Action (in the properties window) for the[/color][/color][/color]
above[color=blue][color=green]
> > file[color=darkred]
> > > > to Embedded Resource?
> > > >
> > > > Watch namespaces. Use Reflector to verify the names of the resources[/color][/color]
> in[color=green][color=darkred]
> > > the
> > > > assembly.
> > > >
> > > > Note: If you have a form names MainFrame, VS.NET will create a
> > > > MainFrame.Resx for you. Use Show All Files in solution explorer.
> > > >
> > > > Hope this helps
> > > > Jay
> > > >
> > > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > > news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...
> > > > > I've been coding a C# project in "pure code" and I would now want[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > > import
> > > > > it into VS.net. I have created a project and imported all[/color][/color]
> sourcefiles[color=green][color=darkred]
> > > and
> > > > > it's compiling without problems, except for the resources. Before,[/color][/color][/color]
I[color=blue][color=green][color=darkred]
> > > built
> > > > > the program using a batchfile and linked the resources with the
> > > > > "/resource:MainFrame.resX" option. Then I loaded them with this[/color][/color]
> code:[color=green][color=darkred]
> > > > >
> > > > > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > > > > Stream resXStream =
> > > > > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > > > > ResXResourceSet resX = new ResXResourceSet(resXStream);
> > > > >
> > > > > The problem is the way VS manages resources. It can't find
> > > MainFrame.resX
> > > > > and i get an error because resXStream = null. I've tried to change[/color][/color]
> the[color=green][color=darkred]
> > > > > "Build Action" -property of the files, but it doesn't seem to make[/color][/color]
> any[color=green][color=darkred]
> > > > > difference. It's the same problem with images. Is there any way to
> > > change
> > > > > the way the resources is included? I don't want to rewrite the[/color][/color][/color]
whole[color=blue][color=green][color=darkred]
> > > > program
> > > > > because of incompability between VS and the compiler.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Marcus Ahlberg
Guest
 
Posts: n/a
#6: Nov 15 '05

re: resources in vs.net


It seems like the only way is to rewrite my code.
Thanks for your help.

"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
meddelandet news:#pNa#XHVDHA.1316@TK2MSFTNGP12.phx.gbl...[color=blue]
> Marcus,[color=green]
> > Yes I set the Build action to Embeded Resource, but it is not exactly[/color][/color]
the[color=blue][color=green]
> > same thing.[/color]
> For bitmaps, other than namespace how is it different? As your found out,
> .resx files are actually compiled and embedded as .resources.
>[color=green]
> > Do you know how to specify witch namespace to put them in?[/color]
> I do not know how to control the namespace that VS.NET uses when it[/color]
includes[color=blue]
> the resource. I wish I did.
>
> The little bit of testing I have done with it, C# seems to behave better
> about it, then VB.NET does. In that the namespaces that C# uses seem more
> natural.
>[color=green]
> > I called "myAssembly.GetManifestResourceNames()" and I found the name
> > "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid[/color][/color]
resX[color=blue][color=green]
> > input. It seems like VS is doing something with the resX-files.[/color]
> VS.NET compiles your .resx files into .resource files, it then embeds the
> .resource file into the assembly. You will need to change your code that
> uses .resx to use .resource. The ResourceManager makes this rather easy.
>
>[/color]
http://msdn.microsoft.com/library/de...us/cptutorials
/html/resourcemanager.asp[color=blue]
>
> Hope this helps
> Jay
>
> "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> news:uX3vxqGVDHA.1172@TK2MSFTNGP11.phx.gbl...[color=green]
> > Yes I set the Build action to Embeded Resource, but it is not exactly[/color][/color]
the[color=blue][color=green]
> > same thing.
> >
> > For the images, it seems like they are included the same way, but they[/color][/color]
are[color=blue][color=green]
> > all put in a namespace like "Marcusoft.TextWrite.res.CommandIcons.bmp"[/color][/color]
but[color=blue]
> I[color=green]
> > want them to exist outside the namespace like "CommandIcons.bmp". Do you
> > know how to specify witch namespace to put them in?
> >
> > I called "myAssembly.GetManifestResourceNames()" and I found the name
> > "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid[/color][/color]
resX[color=blue][color=green]
> > input. It seems like VS is doing something with the resX-files.
> >
> > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > meddelandet news:uBbuawFVDHA.2508@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > Marcus,
> > > That's fine, you do not need to use the WinForm Designer with VS.NET.
> > >
> > > My question still stands: Did you add the MainFrame.resx to your[/color][/color]
> project,[color=green][color=darkred]
> > > and set the build action to Embedded Resource.
> > >
> > > As it sounds like you want to embed the resource in the exactable, to[/color][/color][/color]
do[color=blue][color=green][color=darkred]
> > > this with VS.NET, you add the resx file to your project, and set the[/color][/color]
> build[color=green][color=darkred]
> > > action to embedded resource. Did you do that?
> > >
> > > If you have done the above, and it is still not working, I suspect the
> > > namespace of your resource does not match the namespace you are trying[/color][/color]
> to[color=green][color=darkred]
> > > use to retrieve it. You can use Reflector to verify the namespace. See
> > > http://www.aisto.com/roeder/dotnet/ for Reflector.
> > >
> > > > Is there any way to send this option to the compiler manually in VS?
> > > Yes there is! ;-)
> > >
> > > Build Action = Embedded Resource. Works for .resx files and any other[/color][/color]
> file[color=green][color=darkred]
> > > type you give it.
> > >
> > > Hope this helps
> > > Jay
> > >
> > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > news:OPM$iaDVDHA.1600@TK2MSFTNGP09.phx.gbl...
> > > > I've added the files to the project and tried different settings for[/color]
> > Build[color=darkred]
> > > > Action. I won't be using the WinForm-designer since my forms are[/color]
> > handmade.[color=darkred]
> > > I
> > > > just want to edit my code in vs and use the build function.
> > > > This problem applies to all my images too, and I just want my[/color][/color]
> resources[color=green]
> > to[color=darkred]
> > > > be included the same way that the "/resource:image.png" option does.
> > > > Is there any way to send this option to the compiler manualy in VS?
> > > > Thanks for trying to help me!
> > > >
> > > > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > > > meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...
> > > > > Marcus,
> > > > > Did you include MainFrame.ResX in your project?
> > > > >
> > > > > Did you set the Build Action (in the properties window) for the[/color][/color]
> above[color=green][color=darkred]
> > > file
> > > > > to Embedded Resource?
> > > > >
> > > > > Watch namespaces. Use Reflector to verify the names of the[/color][/color][/color]
resources[color=blue][color=green]
> > in[color=darkred]
> > > > the
> > > > > assembly.
> > > > >
> > > > > Note: If you have a form names MainFrame, VS.NET will create a
> > > > > MainFrame.Resx for you. Use Show All Files in solution explorer.
> > > > >
> > > > > Hope this helps
> > > > > Jay
> > > > >
> > > > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > > > news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...
> > > > > > I've been coding a C# project in "pure code" and I would now[/color][/color][/color]
want[color=blue]
> to[color=green][color=darkred]
> > > > > import
> > > > > > it into VS.net. I have created a project and imported all[/color]
> > sourcefiles[color=darkred]
> > > > and
> > > > > > it's compiling without problems, except for the resources.[/color][/color][/color]
Before,[color=blue]
> I[color=green][color=darkred]
> > > > built
> > > > > > the program using a batchfile and linked the resources with the
> > > > > > "/resource:MainFrame.resX" option. Then I loaded them with this[/color]
> > code:[color=darkred]
> > > > > >
> > > > > > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > > > > > Stream resXStream =
> > > > > > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > > > > > ResXResourceSet resX = new ResXResourceSet(resXStream);
> > > > > >
> > > > > > The problem is the way VS manages resources. It can't find
> > > > MainFrame.resX
> > > > > > and i get an error because resXStream = null. I've tried to[/color][/color][/color]
change[color=blue][color=green]
> > the[color=darkred]
> > > > > > "Build Action" -property of the files, but it doesn't seem to[/color][/color][/color]
make[color=blue][color=green]
> > any[color=darkred]
> > > > > > difference. It's the same problem with images. Is there any way[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > > change
> > > > > > the way the resources is included? I don't want to rewrite the[/color][/color]
> whole[color=green][color=darkred]
> > > > > program
> > > > > > because of incompability between VS and the compiler.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Closed Thread