Comments (14)
@jeffkl I will have a look at upgrading the package tomorrow and report the status to confirm.
from msbuildprojectcreator.
The stacktrace of the failure is:
Test method xxx threw exception:
Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. A node of the required type InProc could not be created.
Stack Trace:
BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
BuildManager.ProcessPacket(Int32 node, INodePacket packet)
INodePacketHandler.PacketReceived>b__0()
BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location where exception was thrown ---
BuildManager.EndBuild()
BuildManagerHost.Build(BuildRequestData buildRequestData, IEnumerable`1 loggers)
BuildManagerHost.Build(ProjectInstance projectInstance, String[] targets, IDictionary`2 globalProperties, IEnumerable`1 loggers, BuildRequestDataFlags buildRequestDataFlags)
ProjectCreator.Build(Boolean restore, String[] targets, IDictionary`2 globalProperties, BuildOutput buildOutput, Boolean& result, IDictionary`2& targetOutputs)
ProjectCreator.TryBuild(Boolean restore, String target, IDictionary`2 globalProperties, Boolean& result, BuildOutput& buildOutput)
ProjectCreator.TryBuild(String target, IDictionary`2 globalProperties, Boolean& result, BuildOutput& buildOutput)
ProjectCreator.TryBuild(String target, Boolean& result, BuildOutput& buildOutput)
.....
from msbuildprojectcreator.
I'm seeing similar errors myself:
But am unable to repro in this project to figure out what's going on. Are you able to test a workaround easily? In my testing, setting an environment variable fixes the issue. But I want to be sure before I update the code. Can you try setting:
MSBUILDNOINPROCNODE=1
So your unit test you can add this to see if it works:
Environment.SetEnvironmentVariable("MSBUILDNOINPROCNODE", "1");
That seems to work for me in the MSBuildSdks repo.
from msbuildprojectcreator.
I’ll be able to try the workaround after the weekend, will update you once I know more
from msbuildprojectcreator.
Now I get an error SolutionOne.sln(2,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 2, position 1. [SolutionOne.sln]
This solution is a hardcoded sln file in the testcase:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectOne", "ProjectOne\ProjectOne.csproj", "{9B189FD2-59BE-4327-97D8-3170AF70C02F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9B189FD2-59BE-4327-97D8-3170AF70C02F}.Debug|Win32.ActiveCfg = Debug|x86
{9B189FD2-59BE-4327-97D8-3170AF70C02F}.Debug|Win32.Build.0 = Debug|x86
{9B189FD2-59BE-4327-97D8-3170AF70C02F}.Release|Win32.ActiveCfg = Release|x86
{9B189FD2-59BE-4327-97D8-3170AF70C02F}.Release|Win32.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {471DDE0F-A01E-4350-B423-6599E9FF7639}
EndGlobalSection
EndGlobal
This worked fine previously (but please note that I am also upgrading from Visual Studio 2019 16.9 to 16.11).
Opening the solution from VisualStudio 2019 itself is ok, and running through MSBuild (commandline) also seems to work ok
from msbuildprojectcreator.
@japj Looks like there's a bug in MSBuild somewhere, its been reported here: dotnet/msbuild#6818
Seems like only building a solution is affected.
from msbuildprojectcreator.
Ok, good to know thanks!
from msbuildprojectcreator.
@japj That was closed as a duplicate of dotnet/msbuild#3517, can you try the workaround from it?
SET MSBUILD_PROJECTINSTANCE_TRANSLATION_MODE=Full
from msbuildprojectcreator.
I get a full "hangup" during the test run.
Manually running msbuild on the solution with both MSBUILDNOINPROCNODE and MSBUILD_PROJECTINSTANCE_TRANSLATION_MODE works ok
However it fails during the tests. Could it be that /nodemode:1
is causing an interaction issue (I saw the tests seem to spawn msbuild with this argument next to /nodeReuse:false /low:false
)
from msbuildprojectcreator.
@jeffkl an addition to my previous comment: the tests seem to hang from VisualStudio on my laptop, but seem to work fine running through vstest on the buildserver, so I don't know what might be causing that
This is with the following added in the test code:
Environment.SetEnvironmentVariable("MSBUILDNOINPROCNODE", "1");
Environment.SetEnvironmentVariable("MSBUILD_PROJECTINSTANCE_TRANSLATION_MODE", "Full");
from msbuildprojectcreator.
Okay I think I'll release a new version with these env vars set and I'll set MaxNodeCount to processor count. Maybe that will fix the hang you're seeing locally.
from msbuildprojectcreator.
That sounds like a good plan!
from msbuildprojectcreator.
I'm not convinced setting those two variables will fix things:
dotnet/msbuild#3517 (comment)
It just crashes for me. Something weird is going on.
from msbuildprojectcreator.
Yeah I'm not able to get it working locally yet. I'm still playing around with coming up with a combination of tricks to make it work.
I need to build out-of-proc because my API depends on NuGet and MSBuild is going to load its own copy. Out-of-proc builds completely solves that (if I can get it to work)
from msbuildprojectcreator.
Related Issues (20)
- Let devs add their own library dll and/or arbitrary file to a package
- TryBuild restore: true and using projectCollection causes Build to be not isolated from "Restore"? HOT 4
- Tests timing out with the MSBUILDNOINPROCNODE change HOT 6
- 'Build' target (and .nuget.g.props) not included in binlog?
- System.IO.FileLoadException: Could not load file or assembly NuGet.Frameworks, Version=6.2.0.146 HOT 8
- Could not load file or assembly 'NuGet.Frameworks, Version=6.2.1.7... HOT 6
- Referencing a local `.nupkg` HOT 2
- Rebuilding project fails with duplicate generated AssemblyInfo HOT 1
- Best practices for preferring local .nupkg HOT 8
- TryBuild fails on plain sdk project build HOT 5
- How to save a binlog for a build? HOT 6
- Collecting build output breaks user specified loggers
- binlog corrupt when build failed? HOT 4
- Question: generate solutions? HOT 1
- Tests requiring NuGetSdkResolver not working? HOT 5
- Restore project information is not present in the binlog HOT 3
- Question: How to use this for integration tests of a roslyn analyzer? HOT 7
- Creating new ProjectCreator throws FileNotFoundException HOT 7
- Document how to handle resolving MSBuild assemblies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msbuildprojectcreator.