Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6676783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:02:07+00:00 2026-05-26T04:02:07+00:00

In my current .Net 4.0 solution, I have one project containing a lot of

  • 0

In my current .Net 4.0 solution, I have one project containing a lot of XML files as embedded resources. There is a lot of development activity going on with these files and there is a very real chance that one of the developers on my team will forget to set the build-action of a particular XML file to embedded resource.

What I have done to insure that this does not happen, and which works perfectly for local builds in VS2010, is to create an automated test in NUnit that counts the number of resources using Assembly.GetManifestResourceNames() and then compares this with a file count in the correct source directory sub-tree of my resource assembly. As long as these match it means that all the files have build-action correctly set to “embedded resource”.

Now, my problem is that my test uses a relative path to find the directory of the files in the resource project and working directory is not the same on the build server (which uses TFS2010).

What is the best way to solve this? I have thought of using environment variables which can be set differently on developer machines and on the build server but ideally I would like something that would require the minimum amount of configuration on developer machines and build server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:02:08+00:00Added an answer on May 26, 2026 at 4:02 am

    Ok, this is the solution I ended up with:

    1. The test checks for a specific environment variable using Environment.GetEnvironmentVariable and if not set uses a relative path that works on development machines using Visual Studio 2010, otherwise it uses the path in the environment variable

    2. For the build server (Team Build) I set an argument for the build process to equal the environment variable and then in my NUnit task I set the NUnit Environment variables to the value of the the build argument.

    This solution makes setting up new developer machines hassle-free but may require some configuration of build-agents if they deviate from default path setup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an older asp.net mvc solution (s#arp framework) whith two projects one for
I have one solution with three projects. DomainModel (C# Library with ADO.NET Entity Framework)
I have a large solution containing many projects with one of them being a
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I'm a .Net developer, but for my current project I have to create some
I have a Visual Studio C# .NET project. I have two master templates. One
We have a Visual Studio 2008 solution with 58 projects. One project targets the
I have a Windows forms project (VS 2005, .net 2.0). The solution has references
Is there an API to get the current ASP.NET Trust Level?
I've had to create a custom membership provider for my current ASP .Net project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.