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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:20:15+00:00 2026-05-27T23:20:15+00:00

Summary: Projects build in wrong order with visual studio and managed C++ and C#

  • 0

Summary:

Projects build in wrong order with visual studio and managed C++ and C# projects

Description:

I have a massive (100+ projects) solution file that is building a few projects in the wrong order. The solution file contains the following types of projects:

  • native C/C++
  • Managed C++
  • Managed C#

The solution contains all the proper dependencies between the different types of projects. Ok, so when I build from the command line (Using MSBuild), there is a problem. The dependencies for the managed projects (both C++ and C#) get built in the wrong order. For instance a project will fail to build because a managed dependency is missing. For instance a managed C++ file will have a using declaration that will fail:

#using <foo.dll>

since foo.dll doesn’t exist yet.

Which means that foo.dll should have been built before, but wasn’t.
Like I mentioned earlier, the dependencies are properly set up in the solution file. For instance, if foo depends on baz, I have this in the solution file…

Project("{C4ABA494-43D0-400A-9917-20E167A12CFD}") = "Foo", "...\Foo.vcxproj", "{5A42640E-9E0A-442B-8A40-AA91AD5444AC}"
    ProjectSection(ProjectDependencies) = postProject
        ...
        {2CE32AE0-B129-40BA-B06E-A628FA149AB3} = {2CE32AE0-B129-40BA-B06E-A628FA149AB3}
    EndProjectSection
EndProject
...
Project("{C4ABA494-43D0-400A-9917-20E167A12CFD}") = "baz", "...\baz.csproj", "{2CE32AE0-B129-40BA-B06E-A628FA149AB3}"
    ProjectSection(ProjectDependencies) = postProject
        ...
    EndProjectSection
EndProject

So the solution file correctly has the dependency. But the dependency in the Foo.vcxproj project is only expressed by the #using directive.
I’ve read on the visual studio blog that there is a known bug in ordering projects in msbuild.
http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe.aspx

Their work around is to add an item called to my projects, like this:

<ProjectReference Include="... foo.csproj"> 
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly> 
</ProjectReference>

Anyways, my question is: do I need to do this ONLY for my managed C++ projects? Or do I do this for Managed C++ AND C# projects?
(I kind of believe I don’t need to do this for C# projects since their dependencies are explicit)

Note: I have tried putting this on ALL projects in my build, and it didn’t work so hot, as I got lots of strange build errors in my native projects…

Thanks for any response to this.

  • 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-27T23:20:15+00:00Added an answer on May 27, 2026 at 11:20 pm

    I had the same issue, but with C# projects only.
    It seems like MsBuild is NOT using solution file dependencies. It is using project references inside the project files to create build order. Try to update all your ProjectReferences to get correct build order. In your case you have to add managed project reference (dependency) into your C++ project file.

    The answer to your question is: Yes, you have to do it for both Managed C++ AND C# projects. Setting dependencies inside sln file is not enough if you are building with MSBuild.

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

Sidebar

Related Questions

I have a C# dll project in Visual Studio 2008. In the project property
VS2010, 100+ projects in solution. I'm tired of seeing the 115+ lines of the
i have a requirement to build some sort of services that can easily be
I have a setup and deployment project that, on our build server, reports the
When you build in 'quiet' mode in Visual Studio 2008, the output looks like
Summary: I'm able to compile a RAD Studio 2009 project using MSBuild on a
I have a Project model and it has some text attributes, one is summary.
I have a MSBuild script that I am executing through TeamCity. One of the
I've generated pseudo-localized versions of an app's resource files (for example Order Summary and
Situation: I have many gzipped input files that I want to process in a

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.