473,771 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I share a resource File between 2 projects in the same Solution?

I have created a Resource file that stores common icons used in my projects.

I have a solution that contains 2 projects, and I keep getting errors if I
add the resource file to both projects.

It complains about duplicates etc etc.

I have tried adding it to the Solution, but then it doesn't appear in the
Designer under resources in the Project.

Any help?

Thanks

Daniel

Sep 21 '07 #1
4 3799
>I have created a Resource file that stores common icons used in my
>projects.

I have a solution that contains 2 projects, and I keep getting errors if I
add the resource file to both projects.

It complains about duplicates etc etc.

I have tried adding it to the Solution, but then it doesn't appear in the
Designer under resources in the Project.

Any help?
Create a new project and call it "Common" (or whatever). Add your shared
resources using this free utility (kudos to the author for a terrific
contribution)

http://dmytro.kryvko.googlepages.com/#feedback
Sep 21 '07 #2
thanks
this method does work in its own way
but is there a non 3rd party way?

We have many development machines, and moving to c# was designed to minimize
the amount of effort involved in making things work across machines /
environments

Dan

"Larry Smith" <no_spam@_nospa m.comwrote in message
news:#e******** ******@TK2MSFTN GP03.phx.gbl...
>http://dmytro.kryvko.googlepages.com/#feedback

Oops, use this link instead:

http://dmytro.kryvko.googlepages.com/
Sep 21 '07 #4
thanks
this method does work in its own way
It's the very same technique that MSFT itself uses in VS (see
"ResXFileCodeGe nerator") except that his version renders all resources
public instead of internal. I believe he even put in a request to MSFT to
add this as an option in a future release (which they should have done in
the first place). Moreover, it even improves upon MSFT's version by adding a
"format" mechanism you can read about at the link. In any case, it's almost
a certainty that his tool relies on the same native .NET class that MSFT
itself apparently uses. See "StronglyTypedR esourceBuilder" in MSDN. IOW, it
appears to be reasonably safe. For what it's worth, I wouldn't simply
install just any 3rd-party software myself. I'm extremely reluctant to
install anything that doesn't have MSFT's name attached to it. However,
because it really is just an enhanced wrapper around MSFT's own class, I
consider the risk to be minimal. The author also appears to be experienced
and MSFT certified (if you believe his bio). Note that this tool also fits
naturally into VS exactly like MSFT's own version (again,
"ResXFileCodeGe nerator") and I've had no problems with it whatosever.
Lastly, it really is the cleanest way of doing things so if you choose
another technique then your code will likely suffer because of it. If you
want to explore the possibilities however then you'ld have to create a
".resx" file in a common (shared) library and expose these resources
yourself somehow (probably by creating a class that exposes them using
public instead of internal methods which is what the
"StronglyTypedR esourceBuilder" class does for you - you'ld therefore be
reinventing his tool all over again).
We have many development machines, and moving to c# was designed to
minimize the amount of effort involved in making things work across
machines / environments
While that may be an issue for some it shouldn't be IMO. It's really no
different then each developr having to install whatever 3rd-party tools are
required for your application. That could be 3rd-party controls, a DB
engine, or in this case, a VS enhancement (similar to installing a 3rd-party
AddIn). My main concern is that because it's free, it's really unsupported
and perhaps may not work in a future version of VS. Again however, I
consider the risk low because of its dependence on MSFT's native class
("StronglyTyped ResourceBuilder ").
Sep 21 '07 #5

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

Similar topics

3
8413
by: AARON PECORARO | last post by:
I need to split apart my web application into multiple projects to allow it to be distributed in parts, but all of the projects need to work together (ie. they need to share session information). Does anyone have any suggestions or solutions to this problem? Thanks, Richard Bowman
11
13170
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...
2
3814
by: HaukiDog | last post by:
Hi, I am trying to set up my C# web project to be compiled by NANT. Everything compiles and works fine within the IDE. I have a created a NANT build file which has a simple project tag, like this: <?xml version="1.0" ?> <project name="MyProject" default="build" basedir="."> <description>The Hello World of build files.</description> <property name="debug" value="true"/>
4
1458
by: dx | last post by:
I have 3 vb.net web applications. I would like all 3 to have access to a library of user controls. server controls wouldn't cause a problem but these are user controls (ascx.) From each solution I reference the user control library project and create a virtual directory under each applicatoin that links to the folder that contains the ascx files but I get a runtime error like: Description: An error occurred during the parsing of a...
8
1985
by: William Meitzen | last post by:
Does someone know how I can get two projects to share a common class? Something like this: solution WholeShmeer project1 code1 CommonClass project2 code2 CommonClass
3
5057
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from the network share. It loads in VS2005 fine, and I can edit and save code changes etc, but when I try and Build the solution, I get the following error... An error occured loading a configuration file: Failed to start monitoring
15
5816
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two non-website code? -Pravin
3
2974
by: bbrewder | last post by:
I am interested in hearing how other people have handled sharing resources in multiple projects (for example, a save icon). We have a product that has many forms within many projects. Many of these forms have a save button with an icon (along with other common buttons and icons). At this point, we've added the icon to each project. Unfortunately, if we want to change the icon, we now have to go to every project and change it. It would...
2
4012
by: Nikolay Belyh | last post by:
1. Why does Visual Studio 2008 started ignoring //{NO_DEPENDENCIES} in resource.h? If I edit file "resource.h" _manually_, it rebuilds the whole solution. It worked just fine with Visual Studio 2005. 2. Why does Visual Studio 2008 not allow having two resource files (that use the same "resoure.h") open at the same time, when they are in different projects of the same solution (localization resource-only dll projects?) It worked just fine...
0
9619
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
10260
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
10038
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
8933
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...
1
7460
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
6712
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
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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.