473,320 Members | 1,876 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,320 software developers and data experts.

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 3775
>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@_nospam.comwrote in message
news:#e**************@TK2MSFTNGP03.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
"ResXFileCodeGenerator") 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 "StronglyTypedResourceBuilder" 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,
"ResXFileCodeGenerator") 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
"StronglyTypedResourceBuilder" 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
("StronglyTypedResourceBuilder").
Sep 21 '07 #5

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

Similar topics

3
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)....
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...
2
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...
4
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...
8
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
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...
15
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...
3
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...
2
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...
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...
0
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...
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...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.