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

  • Home
  • SEARCH
  • 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 6924571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:40:47+00:00 2026-05-27T10:40:47+00:00

I have a few .net / C# projects that I’m building with MSBuild. In

  • 0

I have a few .net / C# projects that I’m building with MSBuild.

In the project I’m building, there are some project references to other C# projects.

I’m only building individual projects, so I’d like to repoint the project references to actual binaries in a folder during the build.

I’m already setting “BuildProjectReferences” to False for my MSBuild step.

So essentially I want to have MSBuild ignore the project refs and look for those binaries in a new directory.

Is this possible to do? Is this possible without having to dynamically modify the project file prior to build?

** Update 1 **

More info might help…I’m actually building each binary via Ant/AntDotNet/MSBuild and uploading to Artifactory. I’m basically using Ivy’s dependency management with .Net binaries.

Right now I have the uploads and downloads of dependencies working fine.

The only part I’m missing is getting MSBuild to look for the binaries as file dependencies instead of the project references that it has in the project file.

** Update 2 **

It looks like MSBuild supports editing the csproj file using XMLPoke and XMLPeek.

So in my case I’d need to change the following in my project file:

<ProjectReference Include="..\MyReferencedProject\MyReferencedProject.csproj">
  <Project>{MyReferencedProjectGUID}</Project>
  <Name>MyReferencedProject</Name>
  <Private>False</Private>
</ProjectReference>

to this

<Reference Include="MyReferencedProject">
</Reference>

Can anyone give me any pointers on that?

  • 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-27T10:40:48+00:00Added an answer on May 27, 2026 at 10:40 am

    I ended up using Ant combined with the xmltask addon.

    <target name="convert" description="convert project references to file references">
        <echo>Converting the following Project references :: ${Project.ItemGroup.ProjectReference.Name}</echo>
        <xmltask source="MyParentProject.csproj" dest="MyParentProject.csproj">
            <rename path="/:Project/:ItemGroup/:ProjectReference/:Name" to="BinaryName"/>
        </xmltask>
        <replace file="MyParentProject.csproj" token="&lt;BinaryName&gt;" value="&lt;Reference Include=&quot;"/>
        <replace file="MyParentProject.csproj" token="&lt;/BinaryName&gt;" value="&quot;&gt;&lt;/Reference&gt;"/>
        <xmltask source="MyParentProject.csproj" dest="MyParentProject.csproj">
            <copy path="/:Project/:ItemGroup/:ProjectReference/:Reference" buffer="refbuffer" append="true"/>
            <paste path="/:Project/:ItemGroup[1]" buffer="refbuffer"/>
            <remove path="/:Project/:ItemGroup/:ProjectReference" /> 
        </xmltask>
        <echo>Conversion complete.</echo>
    </target>
    

    In the first xmltask we are setting the “Name” element to “BinaryName” so we can find it.

    Next we have two Ant Replace tasks that change something like

    "<BinaryName>MyReferencedProject</BinaryName>" 
    

    to

    "<Reference Include="MyReferencedProject"></Reference>"
    

    And in the last xmltask moves our project references we converted into file references into the upper ItemGroup that normally has the file references.

    Then finally we delete the ProjectReferences section.

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

Sidebar

Related Questions

I have a few .Net projects that would benefit from using a document/object database
I'd like to find a few large .NET projects that have public source code
Within my Subversion project I have a few directories that contain other open source
I am building my first few projects with ASP.NET MVC, and I have a
We have a few maven projects that inherit from eachother. Our persistence layer project's
We have several c# projects, libraries and solutions (a few asp.net applications, a few
I have a few controls that inherit from ASP.NET buttons and use onserverclick .
I have a few pages on my asp.net website that I would like to
I have multiple .net projects under a solution. Specifically, i have few content files
I have been using Anthem.NET in ASP.NET 2.0 projects for a few side projects

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.