locked
MSBuild Failure - What Permissions Are Needed To Build Workflow Projects? [CompileWorkflowTask] RRS feed

  • Question

  • I get the following error when running our MSBuild service (via CruiseControl.NET) as Local System.  However, it does not occur when running the service as me.  Please let me know if this is something that has been seen before and what resolution I might find.  Specifically, what permissions requirements are needed to compile Workflow projects using MSBuild?

     

    C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets (127,5):

                                 errorMSB4018: The "CompileWorkflowTask" task failed unexpectedly.

    System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\n8gmcgnr.tmp'.

       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)

       at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()

       at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)

       at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.Execute()

       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

     

    Environment: Windows Server 2008, 64-bit


    Thanks,
    Jonathan


    • Changed type Rong-Chun Zhang Monday, October 27, 2008 8:30 AM limited troubleshooting information
    • Changed type Mike Fourie [MVP] Tuesday, September 8, 2009 3:04 PM has an answer now
    Monday, October 20, 2008 5:43 PM

Answers

  • Found the fix!

    Just use the 64x MSBuild exe.

    C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe
    Monday, September 7, 2009 2:57 PM

All replies


  • Hi Jonathan,

    I am not very clear about your problem. Could you please show us how build the WorkFlow project with CruiseControl.NET?

    Thanks,
    Rong-Chun Zhang

    Please mark the replies as answers if they help and unmark if they don't.
    Wednesday, October 22, 2008 9:57 AM
  • We are changing the issue type to "General Discussion" because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to "Question" by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Thank you!
    Rong-Chun Zhang


    Please mark the replies as answers if they help and unmark if they don't.
    Monday, October 27, 2008 8:30 AM
  • Reviving this thread.  I'm getting the exact same error.  As it turns out, the following folder doesn't exist on my machine!
    C:\Windows\system32\config\systemprofile\AppData\Local\Temp\

    The last part, Temp is missing.  So I created the folder, but I'm still getting the same error.

    The Sytem Account is running my build.  So it seems there's some problem with the system account getting access to its own temp folder.  Why would the temp folder not exist?

    I"m running windows 2008 64-bit.
    Sunday, March 8, 2009 12:31 AM
  • Found the fix!

    Just use the 64x MSBuild exe.

    C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe
    Monday, September 7, 2009 2:57 PM
  • thanks!!!
    Tuesday, September 8, 2009 2:27 PM
  • Hi,

    I am getting error while building Workflow project. Where i should change in the build file for using 64x MsBUild

    Thanks,
    JIJIL
    Software Professional
    Thursday, February 25, 2010 10:18 PM
  • Hi,

    I have the same problem with System user running the MSBuild.exe. I dont seem to have the 64X version of MSBuild.exe on my pc. I am looking in C:\Windows\Microsoft.NET\Framework\v3.5.

    How do I install this or can I download it from somewhere.

    Regards

    Paul
    Monday, March 1, 2010 6:11 PM
  • I know this is an old thread, but I just ran into the same issue trying to build a workflow foundation project on a Windows 2008 64-bit machine using CruiseControl.Net.  The problem was resolved by running the cruise control service under my account credentials instead of the default system credentials.
    Friday, May 7, 2010 2:35 PM
  • As you are using the 32 bit version of msbuild, it gets affected by file system redirection (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx).

    So, even though msbuild is looking for "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\" its actually getting redirected to "C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Temp" under the covers.

    If you create the temp folder in the second location, it works.

    If you create the temp folder using explorer (for example), its 64 bit, so isn't affected by the file system redirection, and therefore creates it in the actual location.

    Hope this helps.

    • Proposed as answer by Charlie Holland Thursday, February 20, 2014 9:19 PM
    Friday, September 14, 2012 9:26 AM
  • Have solved it by my own.

    After adding the \Temp folder under \SysWOW64\... I was punished to use MSBuild x64 because of a new weird bug. It is the newest bug from 07-2016. 32-bit MSBuild.exe running as LOCAL SYSTEM calls 64-bit VBCSCompiler.exe causing CSC : error CS2001: Source file 'file' could not be found

    I can't use MSBuild x64 through DevEnv.com to build Visual Studio setup projects. No way, at all.
    Hopefully I have found a funny way to change current profile folder under any CMD call.

    https://github.com/it3xl/MSBuild-DevEnv-Build-Server-Workarounds/blob/master/wokraround/MSBuild-File-System-Redirector-fail-System32-to-SysWOW64.bat

    This is all I need for my build server.

    And sorry, but you can't use it without Wrapping a call of MSBuild and DevEnv by a batch file. Or the same from this answet http://stackoverflow.com/a/41784486/390940.




    Wednesday, January 11, 2017 8:31 AM