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 6602371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:52:08+00:00 2026-05-25T18:52:08+00:00

This is probably a FAQ, but we weren’t able to find a solution even

  • 0

This is probably a FAQ, but we weren’t able to find a solution even after a lot of searching.

We have a number of msbuild files that all operate on the same set of source files. (It’s not particularly relevant but they compile to completely different platforms.) To make managing these a little simpler, we’d like to move the <Compile> source file names to a separate file and reference that from all the msbuild files.

We tried cutting the <ItemGroup> containing the <Compile> items and pasting it into a new file, and surrounding it with

<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

and then referencing that file from the original with

<Import Project="Common.files.csproj" />

but that does not work – the solution opens (with a warning since we hacked the default config), but no items appear in the Solution Explorer.

What are we doing wrong?

  • 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-25T18:52:09+00:00Added an answer on May 25, 2026 at 6:52 pm

    Tried with Visual Studio 2010:

    1) Create your external .proj (or .target) file and add your files (I used a different item name but that shouldn’t matter)

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <ItemGroup>
            <ExternalCompile Include="Program.cs" />
            <ExternalCompile Include="Properties\AssemblyInfo.cs" />
        </ItemGroup>
    </Project>
    

    2) Import your external .proj file at the top of your Visual Studio project file:

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
       <Import Project="MyExternalSources.proj" />
       <PropertyGroup>
       ...
    

    and modify the Compile ItemGroup like this:

    ...
    <ItemGroup>
        <Compile Include="@(ExternalCompile)" />
    </ItemGroup>
    ...
    

    Warning: You’ll have to add new items/files to your external .proj file – all items/files added from within Visual Studio will end up like this:

    ...
    <ItemGroup>
        <Compile Include="@(ExternalCompile)" />
        <Compile Include="MyNewClass.cs" />
    </ItemGroup>
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This probably has an easy answer, but I haven't been able to find one
This probably has a simple answer, but I must not have had enough coffee
This probably sounds really stupid but I have noo idea how to implement jquery's
This probably is a very very basic question but i can't seem to find
This probably has a really obvious answer, but I can't seem to find it.
This probably has been asked before but all I can find are questions regarding
This probably has probably been asked before, but I couldn't find anything relevant. Would
This probably an obvious solution, but I've been hitting a wall for a while
This probably isn't the most common filename parsing problem, but I have a program
This probably is easy but I cant seem to get lets say I have

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.