473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ 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 1540
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
4292
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
1375
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
1133
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
8170
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
7093
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...
1
7012
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...
0
7468
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...
1
5023
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
4690
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
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1522
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 ...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
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.