Unable to create workflow project using msbuild (Sharepoint 2010)

I use teamcity to create Sharepoint projects using 64-bit MSBuild. All projects work fine, not my workflow. When using Framework 4.0, I get an error

C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Workflow.Targets (121.5): Error MSB4018: The task "CompileWorkflowTask" unexpectedly ended. [In: \ Workflows \ MyCustomer.WFs.TranslationWorkflow \ MyCustomer.WFs.TranslationWorkflow \ MyCustomer.WFs.TranslationWorkflow.csproj] C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Workflow.Targets (121.5) : Error MSB4018: System.IO.DirectoryNotFoundException: Could not find part of path "C: \ Windows \ System32 \ Config \ systemprofile \ AppData \ Local \ Temp \ vjwduioy.tmp. [Q: \ Workflows \ MyCustomer.WFs.TranslationWorkflow \ MyCustomer.WFs.TranslationWorkflow \ MyCustomer.WFs.TranslationWorkflow.csproj]

I remembered that Microsoft got rid of the old Workflow mechanism, so I expected that it might only work with an earlier version 3.5, and built a project with this, but got another error:

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ SharePointTools \ Microsoft.VisualStudio.SharePoint.targets (37,45): error MSB4019: imported project "C: \ Windows \ Microsoft.NET \ Framework64 \ v3.5 \ Workflow.Targets "not found. Verify that the path in the declaration is correct and that the file exists on disk.

In Visual Studio 2010, construction work is just fine.

+7
source share
2 answers

Found solution: I had to create a folder in the folder "C: \ Windows \ system32 \ config \ systemprofile \ AppData \ Local \ Temp \ '

This seemed to be a complete TeamCity problem.

+6
source

Solved by changing the CMD environment.

Adding C:\Windows\system32\config\systemprofile\AppData\Local\Temp\ did not help me.

And C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Tempβ€Œ too. Moreover, after adding the \ Temp folder to \ SysWOW64 ... I was forced to use MSBuild x64 due to a new strange error VBCSCompiler.exe causes CSC: error CS2001: Source file ... could not be found

Also I can not use MSBuild x64 all the time.
I cannot use MSBuild x64 through DevEnv.com to create Visual Studio installation projects. DevEnv only allows x32 MSBuild.

Hope I found a fun way to solve all these errors.
I changed the profile folder for CMD calls by overriding CMD environment variables such as AppData and others.

Here is the full and working version - MSBuild-File-System-Redirector-fail-System32-to-SysWOW64

And sorry, but you cannot use it without a wrapper invoking MSBuild and DevEnv batch file . Or from this answer .

0
source

All Articles