473,651 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5434
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****@microsof t.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****@microsof t.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.no spamschrieb:
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****@microsof t.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****@microsof t.com.

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

Oct 31 '08 #6
"Dick" <Di**@nospam.no spamschrieb:
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
1683
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 error CVT1100: duplicate resource. type:ICON, name:1, language:0x0409". But the resource ID is unique and only located in the new Resource1.h and MyResourceFile.rc files. Any ideas why this error is occuring? To generate the issue real quick, you...
11
13132
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 error CVT1100: duplicate resource. type:ICON, name:1, language:0x0409". But the resource ID is unique and only located in the new Resource1.h and MyResourceFile.rc files. Any ideas why this error is occuring? To generate the issue real quick, you...
1
5832
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 renamed resource files are not automatically linked to the object they belong by the IDE
1
4146
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), but I'm writing in C# now, and it seems that resources are named with string identifiers. Visual Studio doesn't seem to like resource names such as "100", so I'm wondering how this could work. Is it absolutely necessary for me to have a...
3
2613
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 bitmap, and that the default namespace is the assembly name. It then mentions that one can change the default namespace through a project property, but there is no project property to change this in VC++ .NET projects. Is there a way to chaneg the...
6
3405
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 say I enter code at the end of this question in to the code section. How then would I reference this in a new Web Application (or in the same web application for that matter?)
2
4871
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 remove (to start over from scratch) the installation. The messages popping up after choosing one of these two alternatives Repair/Remove Visual Basic.NET Resource Kit in the Visual Basic.NET Resource Kit Setup Wizard are in each case respectively: ...
4
4402
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 information in the namespace, and I think c# projects work this way, too. Is there any way (a vbc command...
0
2011
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 of the problem The main Smart Device Application contains 3 resource files under the Properties folder, in order to produce localization satellite asseblies. Those resource files are named Resources.resx (a default empty resource file),...
0
8275
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
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...
1
8460
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
8576
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
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
4143
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1585
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.