473,406 Members | 2,619 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,406 software developers and data experts.

Assign a namespace to a resource file in a Visual Basic project.

Please can you tell me how to assign a namespace to a resource file in a
Visual Basic project?

In C# such resources file inherit their namespace based upon the folder
hierarchy in which they are stored but in Visual Basic all such resources
appear in the project's default namespace. This is fine when there are just a
few resources but becomes cumbersome when there are lots.

Oct 29 '08 #1
6 5417
Hi Dick,

Thank you for using Microsoft Managed Newsgroup Service, my name is Zhi-Xin
Ye, I'm assigned to help you on this issue.

From your description, you mean VB.NET, right? If misunderstand you, please
let me know.

For VB.NET, it's a by design feature that all the global resource files
will be assigned to My.Resources namespace. However, you can name the
resources files in a manner that they're not corruptted.

For example, you can create a file structure like this:

--Resources
- Res1
+ Res1_Resource1.resx
+ Res1_Resource2.resx
+ Res1_Resource3.resx
- Res2
+ Res2_Resource1.resx
+ Res2_Resource2.resx
- Res3
+ Res3_Resource1.resx
+ Res3_Resource2.resx
+ Res3_Resource3.resx

If you have any problems or concerns, please feel free to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the level

of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the

community or a Microsoft Support Engineer within 2 business day is
acceptable. Please note that each follow

up response may take approximately 2 business days as the support
professional working with you may need

further investigation to reach the most efficient resolution. The offering
is not appropriate for situations

that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working

with a dedicated Microsoft Support Engineer by contacting Microsoft
Customer Support Services (CSS) at

http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Oct 30 '08 #2
OK, by "design feature" I guess you mean "design flaw". I bet if I suggested
you dropped class namespaces and named all your classes in such a way you'd
think I was mad. In any case, you've answered my question and I'll therefore
stop looking for a way to do it, so thanks for that. Cheers.

"Zhi-Xin Ye [MSFT]" wrote:
Hi Dick,

Thank you for using Microsoft Managed Newsgroup Service, my name is Zhi-Xin
Ye, I'm assigned to help you on this issue.

From your description, you mean VB.NET, right? If misunderstand you, please
let me know.

For VB.NET, it's a by design feature that all the global resource files
will be assigned to My.Resources namespace. However, you can name the
resources files in a manner that they're not corruptted.

For example, you can create a file structure like this:

--Resources
- Res1
+ Res1_Resource1.resx
+ Res1_Resource2.resx
+ Res1_Resource3.resx
- Res2
+ Res2_Resource1.resx
+ Res2_Resource2.resx
- Res3
+ Res3_Resource1.resx
+ Res3_Resource2.resx
+ Res3_Resource3.resx

If you have any problems or concerns, please feel free to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the level

of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the

community or a Microsoft Support Engineer within 2 business day is
acceptable. Please note that each follow

up response may take approximately 2 business days as the support
professional working with you may need

further investigation to reach the most efficient resolution. The offering
is not appropriate for situations

that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working

with a dedicated Microsoft Support Engineer by contacting Microsoft
Customer Support Services (CSS) at

http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Oct 30 '08 #3
"Dick" <Di**@nospam.nospamschrieb:
OK, by "design feature" I guess you mean "design flaw". I bet if I
suggested
you dropped class namespaces and named all your classes in such a way
you'd
think I was mad. In any case, you've answered my question and I'll
therefore
stop looking for a way to do it, so thanks for that.
In VB the namespace a resource file belongs to fortunately isn't tied to the
physical folder structure. Instead, you can specify the target namespace by
selecting the resource file and assigning the desired target namespace to
its "Namespace of the user-defined tool" (translated from the German version
of VS 2008) property in the properties window.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Oct 30 '08 #4
Hi Dick,

I'm sorry for the misleading.
Herfried is right. You can change the "Custom Tool Namespace" property for
the resource file to change its namespace.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the level

of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 31 '08 #5
Yup agreed, you can set this property, and of course I looked at this right
at the beginning of my research, but unless I'm mistaken, this doesn't apply
a namespace to the resource. Instead it simply saves a namespace to be used
later by a custom tool, but I don't think the compiler is a custom tool and
hence doesn't use the it. Perhaps you could demonstate it being used?

"Zhi-Xin Ye [MSFT]" wrote:
Hi Dick,

I'm sorry for the misleading.
Herfried is right. You can change the "Custom Tool Namespace" property for
the resource file to change its namespace.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can

improve the support we provide to you. Please feel free to let my manager
know what you think of the level

of service provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 31 '08 #6
"Dick" <Di**@nospam.nospamschrieb:
Yup agreed, you can set this property, and of course I looked at this
right
at the beginning of my research, but unless I'm mistaken, this doesn't
apply
a namespace to the resource. Instead it simply saves a namespace to be
used
later by a custom tool, but I don't think the compiler is a custom tool
and
hence doesn't use the it. Perhaps you could demonstate it being used?
I have tested it here in VS 2008 and it works automatically. Just take a
look at the namespaces and classes in object browser. The program
transforming the ResX files will emit the desired namespace based on the
property's value.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Oct 31 '08 #7

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

Similar topics

0
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
11
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
1
by: Gabriel Lozano-Morán | last post by:
First of all sorry for the cross-posting but I am not sure wether this belongs under internationalization or just general. Environment: Visual Studio .NET 2003 Problem: Newly added and...
1
by: Scott Smith | last post by:
Several attributes and interface methods I'm using refer to resources (such as strings or icons) by a numeric ID. This was the only way to refer to resources in unmanaged code (C++, for example),...
3
by: Edward Diener | last post by:
In the explanation to the ToolboxBitmapAttribute it is mentioned that new bitmaps added to an assembly by Visual Studio .NET get the name of the default namespace prepened to the name of the...
6
by: ryan.d.rembaum | last post by:
Hello, I have code that I wish to use in many web applications. Basically sort of stand utility stuff. So from Visual Studio Project I select add a component and chose Component Class. Lets...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
4
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...
0
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.