-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Build failure related to dependencies in a mixed solution #2366
Comments
What version of VS/msbuild, and was the file that caused the error referenced by a non-SDK project? (I suspect that this is related to dotnet/sdk#1453) I also don't understand what you mean by
Can you clarify? |
@rainersigwald I got the same error today and it is only happening when running msbuild from command line. My structure (simplified, original solution is 45 projects)
The error is reproducable in both dev and build server environment for my solution. Dev environment
Build server
Do you wish me to send link to msbuild.log file by mail to you? (will not attach it here because I don't know if log file contains sensitive information) |
I believe I am also seeing this behavior. I too am moving from the old project file format to the new project file format in a large solution. My theory on what is happening is that the different project file formats specify different build properties (i.e. Is my understanding of what is going on correct? I'd be open to ideas of how to work around this that don't involve turning off concurrency or having to convert everything to the new file format. |
@rainersigwald I can reliably reproduce this issue in a small demonstration solution: https://github.com/johnkoerner/MsBuildConcurrencyProblems This has 2 C# apps each using different types of csproj files and one C++ CLI library that is used by both. The reason I used a C++ CLI library is that it tends to take longer to build and increases the likelihood of problems happening. (And that is the setup that is causing problems on one of my solutions). |
@johnkoerner nice repro! I'll send a PR with the fix. WorkaroundAdd the metadata For example, diff --git a/C.DualTargetLibrary/C.DualTargetLibrary.csproj b/C.DualTargetLibrary/C.DualTargetLibrary.csproj
index d2ae080..09e9603 100644
--- a/C.DualTargetLibrary/C.DualTargetLibrary.csproj
+++ b/C.DualTargetLibrary/C.DualTargetLibrary.csproj
@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net471'">
- <ProjectReference Include="..\B.CppCLILibrary\B.CppCLILibrary.vcxproj" />
+ <ProjectReference Include="..\B.CppCLILibrary\B.CppCLILibrary.vcxproj" GlobalPropertiesToRemove="TargetFramework" />
</ItemGroup>
</Project> |
A multitargeted project referencing a non-SDK project had a race condition. The inner builds each had `TargetFramework` set as a global property, and each passed that global property along when building referenced non-SDK projects. Since those projects aren't aware of TF, they raced each other. Fixes dotnet#2366 for vcxproj references by ensuring that referenced projects which skipped TF checks also don't inherit TF/RID.
I do not reproduce this on 15.7 + .NET Core SDK 2.1.300-rc1 using @Tasteful or @sharwell's repro steps, so I think @johnkoerner's |
After converting a subset of projects from legacy project system to new in antlr/antlrcs@4b0ae50, I found that the build failed due to a file access error until I turned off parallel builds (removed
/m
) in antlr/antlrcs@407a344. I'm guessing this is caused by a failure to properly track dependencies when the build contains both legacy and new projects.I was not able to reproduce this locally in Visual Studio, but the AppVeyor build was consistently failing with the
/m
flag.The text was updated successfully, but these errors were encountered: