TFS Build Server failing - visual-studio

Here at my new work, we are forced to use Microsoft Team Foundation Server 2008, for our builds.
Even most of developers already moved to VS 2010, and 2012, but the build server is still TFS 2008.
Any way, I am working with VS 2010 project, and I built the "default build definition", on 2008 TFS server.
The build is failing.
Looking at the log, it is trying to delete the workspace "agentserver_104_" but didn't find it, but then later try to create the workspace "agentserver_104_". but it fails because there is already a workspace called "agentserver_104".
This is the error message with the log
Target "CoreInitializeWorkspace" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets"
Using "DeleteWorkspaceTask" task from assembly "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll".
Task "DeleteWorkspaceTask"
DeleteWorkspaceTask TeamFoundationServerUrl="http://xxxxx:8080/" BuildUri="vstfs:///Build/Build/21924" Name="agentserver_104_" DeleteLocalItems=True
TF14061: The workspace agentserver_104_;TCPL\TFSBuild does not exist.
Done executing task "DeleteWorkspaceTask".
Task "DeleteWorkspaceTask" skipped, due to false condition;
Using "CreateWorkspaceTask" task from assembly "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll".
Task "CreateWorkspaceTask"
CreateWorkspaceTask TeamFoundationServerUrl="http://xxxxx:8080/" BuildUri="vstfs:///Build/Build/21924" Name="agentserver_104_"
BuildDirectory="E:\TFSBuild\Geofind Modernization\GeoFacility 10.1 - Win7" SourcesDirectory="E:\TFSBuild\Geofind Modernization\GeoFacility 10.1 - Win7\Sources" Comment="Workspace created by Team Build"
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(801,5,801,5): error : The path E:\TFSBuild\Geofind Modernization\GeoFacility 10.1 - Win7\Sources is already mapped in workspace agentserver_104.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(801,5): error MSB4018: The "CreateWorkspaceTask" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(801,5): error MSB4018: Microsoft.TeamFoundation.VersionControl.Client.MappingConflictException: The path E:\TFSBuild\Geofind Modernization\GeoFacility 10.1 - Win7\Sources is already mapped in workspace DAPP03085_104.
Notice that when it tried to delete the workspace, it uses the name agentserver_104_
But the existing name was : agentserver_104
Without the trailing underbar.
any idea?

There seems to be a problem with probably referenced projects i suppose. Because the real error is The path E:\TFSBuild\Geofind Modernization\GeoFacility 10.1 - Win7\Sources is already mapped in workspace DAPP03085_104. So I think you need to check that one.

Related

Can someone explain why I have build task error MSB3491?

When building using Visual Studio 2022, targeting net7.0, net6.0, and netstandard2.0, the build fails with the following warnings in the build output (I don't think multi-targeting has any impact):
>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3588,5): warning MSB3491: Could not write lines to file "obj\Debug\net6.0\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs". Access to the path 'D:\src\XXX\obj\Debug\net6.0\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs' is denied.
>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3588,5): warning MSB3491: Could not write lines to file "obj\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.cs". Access to the path 'D:\src\XXX\obj\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.cs' is denied.
>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3588,5): warning MSB3491: Could not write lines to file "obj\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.cs". Access to the path 'D:\src\XXXn\obj\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.cs' is denied.
When logs are set to verbose, the following is emitted (only including for net7.0 TFM):
> Target GenerateTargetFrameworkMonikerAttribute:
> Building target "GenerateTargetFrameworkMonikerAttribute" completely.
> Input file "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.targets" is newer than output file "obj\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.cs".
> Task "WriteLinesToFile"
> C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3588,5): warning MSB3491: Could not write lines to file "obj\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.cs". Access to the path 'D:\src\XXX\obj\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.cs' is denied.
> The previous error was converted to a warning because the task was called with ContinueOnError=true.
> Build continuing because "ContinueOnError" on the task "WriteLinesToFile" is set to "true".
> Done executing task "WriteLinesToFile" -- FAILED.
> Done building target "GenerateTargetFrameworkMonikerAttribute" in project "HatTrick.DbEx.CodeTemplating.csproj".
The warnings reference temporary files created by the build process prior to compilation.
Things I've tried to figure this out:
If I run dotnet build from the command line, it results in the same.
If I change branches/pull or clean/build/rebuild, the build fails - there are no error messages in the output, only the warnings above.
If I restart Visual Studio and rebuild, the build succeeds, but still has the warnings.
I've tried on another machine and it works as expected (no errors or warnings) - I cannot reproduce this issue on another machine.
I don't think it's a file/directory permission exception because I can rebuild and the build process outputs the assemblies to the bin and obj folders just fine.

Azure devops failing to build visual studio sql database project: SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found

I have a sql database project in Visual Studio (2019).
I am trying to deploy it via azure devops.
The pipeline is failing due to the below error:
##[error]C:\azagent\A1_work\r1\a_Transcripts-SQLDeployment\SampleDatabaseProject\SampleDatabaseProject\SampleDatabaseProject.sqlproj(117,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk
The project builds without issue on my pc.
In the pipeline I have tried both the MSBuild and Visual Studio Build tasks, but the result is the same in each case.
Steps tried:
I found the reference in the sqlproj file xml, and removed it but this did not resolve the issue.
Appreciate any expertise on how to resolve this.

Visual Studio 2017 Build Solution fails

Build Solution fails in VS 2017:
Have tried the following:
Rebuilt project
Reinstalled Nuget package
Reinstalled VS 2017
Still hitting the same error.
The "GetReferenceNearestTargetFrameworkTask" task was not found. Check the following:
1.) The name of the task in the project file is the same as the name of the task class.
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" directory.

Why am I getting access denied to these files?

Suddenly I cannot rebuild my project in VS 2017. I get these messages:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4222,5): error MSB3021: Unable to copy file "C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.1.0\FSharp.Core.dll" to "bin\Debug\FSharp.Core.dll". Access to the path 'bin\Debug\FSharp.Core.dll' is denied.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4222,5): error MSB3021: Unable to copy file "H:\Dropbox\BitBucket\VSProjects\Fractal10\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" to "bin\Debug\Newtonsoft.Json.dll". Access to the path 'bin\Debug\Newtonsoft.Json.dll' is denied.
Any suggestions on how to solve this problem?
Possible causes:
The app you are trying to build/debug can be running or stuck open
Tests locking the assemblies could be using them
post-build steps listed in the properties page of a project could be using them
while building multiple projects in parallel: another project could have decided to use those dll in the output folder for those references
Visual Studio's F# interactive if set to not shadow copy assemblies could cause it.
anything else that causes a file to be locked in windows
It happened today for me, I had pulled a branch from git repo and the project was not getting compiled or cleaned.
I had to uncheck read-only option for the root directory and the nested files & folders of the root directory.
Go to the folder where the project is, right click on the directory, click properties, Uncheck Read-only option.

BizTalk deployment framework throws MSBuild errors MSB4061

I am having some problems with the BizTalk Development Framework.
My BizTalk project builds completely fine. But when using the 'Deploy BizTalk Solution' option from Visual Studio MSBuild is not happy. I am deploying to a server that is on our internal network, but not on the same box as my development machine.
These are the errors (it seems to be complaining about a bunch of missing assemblies, but my setup is a plain BizTalk 2013 R2 development tools install and the deployment framework does it need the full server installing on the dev machine?):
DeployFileAdapterPhysicalPaths: Configuring FILE adapter physical
paths from binding file PortBindings.xml...
Processing FILE adapter physical paths (Send)...
Processing FILE adapter physical paths (Receive)...
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: The "TerminateServiceInstances" task could not be
instantiated from "C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.Tasks.BizTalk.dll".
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: System.IO.FileNotFoundException: Could not load file or
assembly 'Microsoft.BizTalk.Operations, Version=3.0.1.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: File name: 'Microsoft.BizTalk.Operations,
Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: at
DeploymentFramework.BuildTasks.TerminateServiceInstances..ctor()
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061:
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: WRN: Assembly binding logging is turned OFF.
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: To enable assembly bind failure logging, set the
registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to
1.
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: Note: There is some performance penalty associated with
assembly bind failure logging.
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061: To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4061:
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
C:\Program Files
(x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.targets(1986,5):
error MSB4060: The "TerminateServiceInstances" task has been declared
or used incorrectly, or failed during construction. Check the spelling
of the task name and the assembly name.
[C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj]
Done Building Project
"C:\Users\asmiddle\Source\Workspaces\NYCC.LSI\Biztalk.Deployment\Biztalk.Deployment.btdfproj"
(Deploy target(s)) -- FAILED.
Build FAILED.
In addition to Zee's correct point, this is failing because BizTalk is not installed on your local machine. You cannot deploy from Visual Studio to a remote machine for BizTalk, even using BTDF. It's trying to deploy locally and failing because it can't find some of the BizTalk assemblies that BTDF relies on for deployments.
If you want to deploy remotely, you should use BTDF to build an MSI and run the MSI on that target server(s).
The 'Deploy BizTalk Solution' function in Visual studio is used to deploy your application to local biztalk, not the remote biztalk server.
Official document here:
Deploy and Undeploy an Application
The Deploy BizTalk Solution option will deploy your application into
the local BizTalk server. If the application is already deployed,
then it will be undeployed and re-deployed. The Visual Studio Output
window will display the complete output from the deployment process.
In the end Dan was pretty close here. These errors were caused by the fact I had a installer project in the same solution that installed a custom pipeline in the GAC. It was being very naughty with the dependencies - it detected a lot of Biztalk assemblies as dependencies, but if an uninstall was done it would remove them all! Thus crippling the Biztalk setup on the box.
Point taken about the local install though.

Resources