473,624 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embedded resource namespace

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
information in the namespace, and I think c# projects work this way,
too. Is there any way (a vbc command option maybe?) to get what I'm
looking for?

Thanks,

Jason
www.pettysconsulting.com
Nov 21 '05 #1
4 4401
Hi

Which version VS.NET are you using, 2003 or 2005?
Based on my test, even if we create a folder named TestFolder, and put the
aspx page into the folder, after compilation, the namespace is still
Rootnamespace.f ilename.
I think the namespace is the logical organization, but the folder is just
the physical organization. Even we put two file with different namespace in
one folder, the namespace will not change.

I think in the project properties, we can set the Rootnamespace property,
so that we can change that to make the final namespace looks like
Root.TestFolder .filename.

If I have any misunderstandin g, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #2
Thank you for your response! I'm using VS.NET 2003.

I'll have to explain a little better.

In a c# project the namespace of embedded resources follows the folder
structure, but in a vb.net project it does not.

Example:
root namespace=Root
resource is "File.bmp" located in project folder "Div"
In c#, the resource name will be Root.Div.File.b mp,
but in vb it will be Root.File.bmp.

This is a problem if you have two folders in your project, both with a
File.bmp; in c# they will be distinguished by namespace, but in vb
you'll get a compilation error.

To make things more interesting, the .resource files that are embedded
in vb projects DO have namespaces that follow the folder path.

It would be interesting to know the story behind this behavior, but what
would be most helpful to me is a way to specify a namespace for embedded
resources, or to set an option so that the namespaces follows the folder
path like in c# projects.

Your suggestion to change the Rootnamespace would change the namespace
of the embedded resource, but still does not allow files of the same
name in different folders to be embedded in a vb project, while they can
be in a c# project.

Hope this clarifies things. As I think about the problem I think I
could probably switch to building with NAnt to solve this, but I'd
rather not go that far for this change.

Thanks!

Jason

Peter Huang [MSFT] wrote:
Hi

Which version VS.NET are you using, 2003 or 2005?
Based on my test, even if we create a folder named TestFolder, and put the
aspx page into the folder, after compilation, the namespace is still
Rootnamespace.f ilename.
I think the namespace is the logical organization, but the folder is just
the physical organization. Even we put two file with different namespace in
one folder, the namespace will not change.

I think in the project properties, we can set the Rootnamespace property,
so that we can change that to make the final namespace looks like
Root.TestFolder .filename.

If I have any misunderstandin g, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #3
Hi

I understanding your concern, and now I am researching the issue, I will
update you with new information ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
Hi

Based on my research, I think it is the feature of C#.
I think you may contact MSWISH program to submit your idea.
How to Contact the Microsoft Wish Program
http://support.microsoft.com/default...b;en-us;114491

You may try to use use the Email or Phone approach.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5

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

Similar topics

1
24154
by: james | last post by:
What class / method should I be using to get the full path to an embedded resource ? In my case I have an .xml file that my app uses, it is set as embedded resource, and I have a control that needs to load it, but I do not want to hard code the path since that may change for different installs. i.e. GetPathForResourceOfName ( myResourceFileName ) thanks, JIM
5
8219
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'.
7
19226
by: Christofer Dutz | last post by:
Hi, I am trying to read a XML-File which I marked as embedded resource from within the code of my DLL. Unfortunately it doesn't work. On my search for the error I inserted some code for outputing all Resources names to a simple textfile. Here nothing is output. Here my code (a little messy after about 3 hours of debugging): // Use the LoadXml method to load the XslTransform
2
6958
by: steve bull | last post by:
I created an embedded resource by adding a Swatches.xml file to my Solution and then making it an embedded resource in the VS IDE. When I try to open a stream to the resource using GetManifestResourceStream("Swatches.xml") it fails. Do I need to prefix the resource with a namespace or something? Thanks,
0
2190
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 resources stored in the DLL. There is essentially an embedded resource "section" for each web form. The...
1
1838
by: Dirc Khan-Evans | last post by:
I am trying to localise my app using embedded resource and sattellite assemblies. I can get it working using the following if I have a resource file with the same name as the class: ResourceManager resourceManager = new ResourceManager(this.GetType()); However, I want to use a global resource for my assembly.
1
15702
by: Steve Richter | last post by:
I am embedding an xml file in my class library assembly. In solution explorer I right click a folder, add , new item, xml file. then on the xml file I right click, properties, build action = embedded resource. build the class library, run the following code to access the XML as a stream: Stream cmdsStream =
10
4085
by: Alain R. | last post by:
Hi, I have some problem to retrieve an image from my application. Here is my code : Stream imgStream = null; Assembly a = Assembly.GetExecutingAssembly(); imgStream = a.GetManifestResourceStream("SW_Audit.img_ok.gif"); PBStep1.Image = new Bitmap(imgStream);
6
21639
by: CSharpProgrammer | last post by:
Hi, I followed an example that loads an embedded resource http://support.microsoft.com/kb/324567 That works just fine and dandy. My problem is that my namespaces are setup a bit differently. I tried using both namespaces and neither seem to work. I'm assuming it shoud be the First_namespace, since that is the project namespace.
0
8242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
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
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.