Using Post Beta release w/ RC1 of 2010 causes build problems

Feb 17, 2010 at 6:43 PM

I cannot seem to succesfully complete a build of my custom project using the post release and the RC1 of 2010.  

The problem is "BuildSubmission submission = BuildManager.DefaultBuildManager.PendBuildRequest(requestData);" throws an exception stating that BeginBuild has not been called.  Any ideas?

Mar 22, 2010 at 11:33 AM

Repro but, this problem only happends to me the first time that I build the project.

I have another problem related to builds. The build completes (succesfully or not) but Visual Studio never returns from building state.

I am using 10.1. It seems that build system is complete broken in this release.

Mar 22, 2010 at 1:46 PM

I eventually got it to build my custom project types with out a hitch but it required ugly hacks.  With the release of 2010 just around the corner in April, I'm hoping they will post a new update a few days early to fix these issues but I wouldn't hold my breath on any fixes before then.

Mar 22, 2010 at 4:08 PM

Can you tell me whether this problem repros for you with the original CustomProject sample that's included in the source distribution?  Or is this only reproducible once you apply the updates to your own project systems?  If only in your own, can you include a stack trace of the exception you're seeing?

Mar 22, 2010 at 4:45 PM

The CustomProject sample work well.

Here is the call stack, copied and pasted form VS, if you need more infomation please ask :

[External Code] 
> PlainTools.COBOLizer.dll!Microsoft.VisualStudio.Project.ProjectNode.DoMSBuildSubmission(Microsoft.VisualStudio.Project.BuildKind buildKind, string target, System.Action<Microsoft.VisualStudio.Project.MSBuildResult,string> uiThreadCallback) Line 2926 + 0x1b bytes C#
  PlainTools.COBOLizer.dll!Microsoft.VisualStudio.Project.ProjectNode.BuildAsync(uint vsopts, string config, Microsoft.VisualStudio.Shell.Interop.IVsOutputWindowPane output, string target, System.Action<Microsoft.VisualStudio.Project.MSBuildResult,string> uiThreadCallback) Line 1958 + 0x16 bytes C#
  PlainTools.COBOLizer.dll!Microsoft.VisualStudio.Project.BuildableProjectConfig.Build(uint options, Microsoft.VisualStudio.Shell.Interop.IVsOutputWindowPane output, string target) Line 991 + 0xb4 bytes C#
  PlainTools.COBOLizer.dll!Microsoft.VisualStudio.Project.BuildableProjectConfig.StartBuild(Microsoft.VisualStudio.Shell.Interop.IVsOutputWindowPane pane, uint options) Line 877 + 0x71 bytes C#
  [External Code] 

In the output window:

------ Build started: Project: COBOLizer83, Configuration: Debug x86 ------

Unhandled Exception:The operation cannot be completed because BeginBuild has not yet been called.

Error: The operation cannot be completed because BeginBuild has not yet been called.

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

The .proj file only contains the following:

 <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{210af0dd-0be1-47fb-9c6e-49e941d795f4}</ProjectGuid>
    <AssemblyName>COBOLizer83</AssemblyName>
    <Name>COBOLizer83</Name>
    <RootNamespace>COBOLizer83</RootNamespace>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <OutputPath>bin\Debug\</OutputPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>bin\Release\</OutputPath>
  </PropertyGroup>
 
  <Target Name="Build">
    <Message Text="Build launched..." />
  </Target>
</Project>


Thank you very much.

Mar 22, 2010 at 5:01 PM

Hmmm... BeginBuild should have been called by the solution build manager before ever invoking your project system.  Do you repro this by clicking Build Solution in the IDE?

Mar 22, 2010 at 5:06 PM

Yes, I can repro it with Build Solution.
I get exactly the same behavior.

Mar 24, 2010 at 5:41 PM

rcorral,

Can you please expand [External Code] and include the rest of the callstack?  Also, if you have multiple projects in the soluton and you hit Build Solution, do the other project systems succeed at building while yours fails?

Mar 24, 2010 at 8:57 PM

If I expand external code I only get [Native To Managed Transition]...

If I create a multiproject solution with one project of my project type and a C# project, the error related to BeginBuild not called do not appears but the error relate to VS hanging after build my project.

When VS hangs there are some threads with names like RequestBuilder, Build Engine Loop waiting in a WaitHandle.WaitAny ... It looks like a deadlock.

The call stack for this threads is similar in all of them:

Unflagged  4084 13 Worker Thread RequestBuilder thread [In a sleep, wait, or join] Normal
In a sleep, wait, or join] 
> mscorlib.dll!System.Threading.WaitHandle.WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) + 0x8b bytes 
  Microsoft.Build.dll!Microsoft.Build.BackEnd.InProcNode.Run(out System.Exception shutdownException) + 0xb1 bytes 
  Microsoft.Build.dll!Microsoft.Build.BackEnd.NodeProviderInProc.InProcNodeThreadProc() + 0x18 bytes 
  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x63 bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xb0 bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x2c bytes 
  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes 
  [Native to Managed Transition] 

Unflagged  1120 15 Worker Thread Build Engine Loop (Default) [In a sleep, wait, or join] Normal
[In a sleep, wait, or join] 
> mscorlib.dll!System.Threading.WaitHandle.WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) + 0x8b bytes 
  Microsoft.Build.dll!Microsoft.Build.BackEnd.InProcNode.Run(out System.Exception shutdownException) + 0xb1 bytes 
  Microsoft.Build.dll!Microsoft.Build.BackEnd.NodeProviderInProc.InProcNodeThreadProc() + 0x18 bytes 
  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x63 bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xb0 bytes 
  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x2c bytes 
  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes 
  [Native to Managed Transition] 

Thank your very much for your help.

 

Mar 24, 2010 at 9:50 PM
Edited Mar 24, 2010 at 9:51 PM

Like MPF, the C# project system relies on the Solution Build Manager having already invoked BeginBuild when the user activates the ‘Build’ action from the menu.  Hanging after the build has most frequently been due to improper handling of logging messages.  Can we get a dump file in each of these scenarios: (if you're willing, send me a private message via CodePlex to arrange where you can send your dump file)

    1. When no other projects are loaded except your custom one, do a build, and break on the exception which is thrown when the BuildManager faults because BeginBuild hasn’t been called.
    2. When VS is hung.
Mar 25, 2010 at 7:27 PM

Alternatively can you set a breakpoint on the buildcomplete callback from MSBuild into your project system and ensure that execution flows all the way to calling VS to say the build is done? I suspect something is failing there.

Mar 30, 2010 at 1:04 PM

Hello aarnott:

What seems to be happening when VS hangs after build is that ProjectConfig.Build calls config.ProjectMgr.BuildAsync passing this.NotifyBuildEnd as callback, but NotifyBuildEnd never gets called.

I have the two dumps that you requested for. They are huge, about 200MB compressed. How can I provide them to you?

Thank you very much for your help.