473,473 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Only embed some resources in certain build configurations?

I have some resources in my C# Visual Studio 2005 project that are
involved with self-test. Ideally, they shouldn't be in a released
product.

These resources are embedded by virtue of having their Build Action
property set to Embedded Resource.

Is there any way to add conditions to when they are embedded? For
instance, can I create a build configuration under which they are not
embedded?
Jun 27 '08 #1
3 1539
Yes; not via the IDE, but you can edit the csproj directly (right click,
unload, edit) - add an attribute to the EmbeddedResource element:

<EmbeddedResource Include="Foo.txt"
Condition="'$(Configuration)'=='Debug'" />

(or whichever configuration you want to include it in)

Marc
Jun 27 '08 #2
On 14 Apr, 10:56, Marc Gravell <marc.grav...@gmail.comwrote:
Yes; not via the IDE, but you can edit the csproj directly (right click,
unload, edit) - add an attribute to the EmbeddedResource element:

<EmbeddedResource Include="Foo.txt"
Condition="'$(Configuration)'=='Debug'" />

(or whichever configuration you want to include it in)

Marc
Thanks. That works fine. Is it likely that Visual Studio will
overwrite my hand-edited addition in the future, or is it smart enough
to persist it, once added?
Jun 27 '08 #3
I haven't seen any oddities... you might want to keep an eye on it when
changing from 2005 to 2008, for example, but in general it seems to know
enough to leave it alone...

But if you see any problems...

Marc
Jun 27 '08 #4

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

Similar topics

7
by: axis | last post by:
What I want to do is pretty simple: I have a bunch of icons in my application project (visual studio .net 2003), and I want to embed those in the executable, and access them through code. I've...
0
by: amartos | last post by:
Hi, I am trying to create a dll file from several resources files. I am using visual studio .net and I have a c++ project which has included a file called "Resource.es-ES.resources", in the...
1
by: Graham | last post by:
H I have two resource files: strings.resx and strings.fr.res Both files have the build action property set to Embedded Resource When I build my project, the dll is placed under the bin/debug...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
0
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...
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...
1
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...
1
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...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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...

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.