Giter Site home page Giter Site logo

Comments (14)

japj avatar japj commented on July 18, 2024 1

@jeffkl I will have a look at upgrading the package tomorrow and report the status to confirm.

from msbuildprojectcreator.

japj avatar japj commented on July 18, 2024

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.

jeffkl avatar jeffkl commented on July 18, 2024

I'm seeing similar errors myself:

https://dev.azure.com/dnceng/public/_build/results?buildId=1340250&view=ms.vss-test-web.build-test-results-tab&runId=39263738&resultId=100008&paneView=debug

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.

japj avatar japj commented on July 18, 2024

I’ll be able to try the workaround after the weekend, will update you once I know more

from msbuildprojectcreator.

japj avatar japj commented on July 18, 2024

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.

jeffkl avatar jeffkl commented on July 18, 2024

@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.

japj avatar japj commented on July 18, 2024

Ok, good to know thanks!

from msbuildprojectcreator.

jeffkl avatar jeffkl commented on July 18, 2024

@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.

japj avatar japj commented on July 18, 2024

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.

japj avatar japj commented on July 18, 2024

@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.

jeffkl avatar jeffkl commented on July 18, 2024

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.

japj avatar japj commented on July 18, 2024

That sounds like a good plan!

from msbuildprojectcreator.

KirillOsenkov avatar KirillOsenkov commented on July 18, 2024

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.

jeffkl avatar jeffkl commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.