473,563 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedded resources and extended namespaces

Hi there!

I did not know, where this topic fits in, so I put it here.

I have a minor problem with embedded resources, which puzzles me quite a
lot. I'd be glad if anyone can help me on this:

I've added a few files (images) to an assembly as embedded resources.
Within the project folder these files are in a subfolder named "images".

Now while trying to access them I expected to get them this way:
RootNameSpace.N ameOfSubfolder. FileName
i.e.:
NameSpaceOfMyPr oject.Images.My Image.jpg

This is how it is explained in here:
Understanding Embedded Resources in Visual Studio .NET
http://www.codeproject.com/dotnet/embeddedresources.asp
But what I experience under VB.NET, ist that it is not possible to organize
embedded resources this way - meaning: the name space won't extend by the
name of the subfolder.

It's just this way:
RootNameSpace.F ileName
i.e.:
NameSpaceOfMyPr oject.MyImage.j pg

This behavoir fits more to what is discribed this article:
How to Embed Resource Files in .NET Assemblies (cont'd)
http://www.devx.com/dotnet/Article/10831/0/page/2

Ok, so far you'd might think, that one of the authors is wrong.
But the answer is: No, they both seem to be right!

I have downloaded and tried a C#-example from Eric Woodroff:
A Resource Server Handler Class For Custom Controls
http://www.codeproject.com/useritems...edded%7Cresour
ce

As you can see there, the namespace extends, as expected first.

This drives me nuts!!!
*bangingheadtow all*
;-)

Is there a difference how VB.NET and C# handle embedded Resources?
Did I forget to configuere something?
Did I misunderstand something?

Please help me - otherwise I go crazy and won't come back!! ;-)

Thanx!

Philipp Seidel

(P.S.: Actually this is kind of a crossposting. I posted this subject last
week in microsoft.publi c.dotnet.framew ork.aspnet.buil dingcontrols and was
probably kind of offtopic there, since no one answered. Sorry for that!)


Jul 19 '05 #1
1 3140
I'm just too stupid!!!!!
Sorry!!!

Philipp Seidel
(the one who goes hiding in the cellar now)
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
761
by: Philipp Seidel | last post by:
Hi there! I did not know, where this topic fits in, so I put it here. I have a minor problem with embedded resources, which puzzles me quite a lot. I'd be glad if anyone can help me on this: I've added a few files (images) to an assembly as embedded resources. Within the project folder these files are in a subfolder named "images".
5
8213
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: 'null' is not a valid value for 'stream'.
0
1667
by: Chris Schremser | last post by:
I have a question regarding embedded controls in IE. We are looking to replace a small VB ActiveX control with something written in C#. We have written the control and it instantiates correctly in IE using the <object> tag. My question is this. When the browser visits the pages and requests the object from the server, it appears to be...
2
1881
by: Kyle Kaitan | last post by:
I have an assembly (AppResources.dll) which contains a number of embedded resource files. Most of these are key/value pairs of relevant strings; a few are images and sounds; some more are XML files. My application will load the resources into memory as they are needed. I would like to be able to read and write to these embedded resources. ...
1
1703
by: richlm | last post by:
If I embed a resource with filename "test_cs.xslt" in my c# project, Assembly.GetExecutingAssembly.GetManifestResourceNames works as expected. If I change the filename to "test.cs.xslt" I get 0 items. Is there a good reason for this behaviour or is it a bug?
7
5398
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to need to be updated with the current copy before being built. I also don't want projects being built with the old copy. Thanks! Bill
4
5876
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm generating a very simple installer app that embeds referenced .dll files inside it, which are extracted and referenced when the installer app is...
0
2187
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have multiple web forms. When you compile the application, it creates a DLL. If you view this DLL using ILDASM (the manifest), it shows info about the...
4
4398
by: Jason Pettys | last post by:
In an ASP.NET project I am setting the content type of my .ascx and ..aspx files to Embedded Resource for a separate reason. When I do this they get embedded as "RootNamespace.Filename" but I would like them to be embedded as "RootNamespace.Folder.Filename". I see that the .resources files are embedded with the containing folder...
3
1343
by: Patrick | last post by:
Hello All, I'm getting into nHibernate for a project at work. I've organized my xml files into a folder within the project and have chosen to embed them into the assembly. However, the nHIbernate framework cannot find the xml files because they are in the "folder". Could someone explain how namespaces and folders work with the compiler? Or...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.