473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 4365
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.filename.
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 misunderstanding, 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.bmp,
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.filename.
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 misunderstanding, 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
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...
5
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...
7
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...
2
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...
0
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...
1
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: ...
1
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 =...
10
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 =...
6
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....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.