Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The recursive MSBuild task UseDebugCRT forces incorrect solution build #34

Open
DHowett opened this issue Dec 5, 2020 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@DHowett
Copy link
Member

DHowett commented Dec 5, 2020

There is a task, UseDeubgCRT, that forces the evaluation of a project file in the wrong context.

That context is missing the SolutionDir global property because it is using ProjectCollection.LoadProject with a hardcoded set of properties.

This causes any projects that <Import> files based on SolutionDir to fail to load.

Using MSBuild programmatically in this way, you must use:

var project = ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectPath).FirstOrDefault();
@taenri
Copy link

taenri commented Aug 29, 2023

I am having the same exact issue with our product. Has any progress been made towards solving this issue?

EDIT:
To potentially save others a lot of pain, setting the VCRTForwarders-IncludeDebugCRT property to false for Release configurations solved our issue!

We were having problems with one of our vcxproj dependencies that used the MSBuild GetDirectoryNameOfFileAbove property function that took $(SolutionDir) as one of its parameters. This task for some behaves differently with Release configuration than Debug, so it is best to just skip the task altogether in Release config since it is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants