472,981 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

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 1530
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.