msb4018: the "createvirtualdirectory" task failed unexpectedly - btdf

While deploying Biztalk application I am getting below error:
\Program Files (x86)---- for BizTalk 1.0.0\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1829,5): error MSB4018: The "CreateVirtualDirectory" task failed unexpectedly.\r
C:\Program Files (x86)-----for BizTalk 1.0.0\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1829,5): error MSB4018: System.Runtime.InteropServices.COMException (0x80070003): The system cannot find the path specified.\r
C:\Program Files (x86)----- for BizTalk 1.0.0\1.0\Deployment\Framework\BizTalkDeploymentFramework.targets(1829,5): error MSB4018: \r

"COMException (0x80070003): The system cannot find the path specified."
Since this is happening during app deployment via an MSI generated with the Deployment Framework, it appears that the physical folder for the virtual directory does not exist. Maybe it is not being packaged in the MSI at all, or maybe the location is different than the one specified in the .btdfproj.
I suggest you review the IIS sample application included with the Framework.

Related

Failed to use use "MSBuild.ILMerge.Task" with PackageReference

When using MSBuild.ILMerge.Task referenced via packagereference the following error came up:
error MSB4018: The "MSBuild.ILMerge.Task" task failed unexpectedly.
error MSB4018: System.IO.FileNotFoundException: Cannot find ILMerge
executable.
error MSB4018: at MSBuild.ILMerge.Task.LoadILMerge()
error MSB4018: at MSBuild.ILMerge.Task.Execute()
error MSB4018: at error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
This is because the MSBuild.ILMerge.Task.dll can't find the ILMerge executable in its package location. I guess the main reason of this may be the different folder structure between package.config and PackageReference.
Has anyone else had this issue? Any help is appreciated in advance
You could try downgrading ILMerge to 2.14.1208.
This solved it for me.
https://github.com/emerbrito/ILMerge-MSBuild-Task/issues/13
I had the same problem. In my case it arose due to the following reasons (related to some updates in my Nuget packages):
sometimes I had few conditions in my project files to handle Nuget packages. When ever I updated my Nuget packages, these project files were updated and all my conditions were overwritten. I found this issue by using diff tools in Git and add my conditions manually then everything was working fine.
Again sometimes I need to update my Nuget packages (my solution includes multiple dependent projects, so I need to update my Nuget packages when I build a new version). If I forgot to commit my changes in Git (including package.config and project files) the same issues appeared (in release mode).

Microsoft.Build.CPPTasks.Common cannot find Microsoft.Build.Tasks.Core

I just upgraded a project from Visual C++ 2012 to Visual C++ 2017 and I'm getting build failures from MSBuild:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\src\my-project.vcxproj]
The Fusion log shows bad things:
*** Assembly Binder Log Entry (2/12/2018 # 1:44:29 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = msbuild.exe
Calling assembly : Microsoft.Build.CPPTasks.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
LOG: All probing URLs attempted and failed.
Just posted this at Visual Studio Community but in another almost identical bug report they closed it as "Not a Bug" for reasons I cannot comprehend. I'm hoping StackOverflow will be more helpful. :)
Microsoft.Build.CPPTasks.Common cannot find Microsoft.Build.Tasks.Core
It seems you are using the old MSBuild.exe from .NET framework. You should use the MSBuild.exe from following location after you upgraded your project from VS2012 to VS2017:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
That because MSBuild is now part of Visual Studio!:
Starting with Visual Studio 2013, the 2013 version of MSBuild will
ship as a part of Visual Studio instead of the .NET Framework. This
transition allows us to more rapidly evolve MSBuild.
Hope this helps.
You will have to edit the file in this directory:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets
Called:
Microsoft.Cpp.Clang.targets
Edit line 17 into:
<UsingTask TaskName="ClangCompile" AssemblyFile="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll"/>
Be warned if this does create additional problems you might need to install proper MSBuild.

TFS 2010 Build SharePoint with WCF Service

I am attempting to set up some continuous integration for a clients SharePoint environment.
The issue I am running into is with SharePoint projects that include a WCF service.
The project in question builds fine but fails when it attempts to package and deploy on the build server.
The project builds and deploys fine from Visual Studio, the problem only occurs on the TFS Build server.
The Error thrown by the Build Agent is as follows:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets (378): The "ValidatePackage" task failed unexpectedly. System.InvalidOperationException: The project service is not a serialized SharePoint project service. at Microsoft.VisualStudio.SharePoint.Tasks.ValidatePackage.OnCheckParameters() at Microsoft.VisualStudio.SharePoint.Tasks.BuildTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
The following is the error from MSBuild Logs :
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(378,5): error MSB4018: The "ValidatePackage" task failed unexpectedly. [C:\BuildsNew\4\SharePrice\SharePrice_Dev\Sources\SharePrice\SharePrice.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(378,5): error MSB4018: System.InvalidOperationException: The project service is not a serialized SharePoint project service. [C:\BuildsNew\4\SharePrice\SharePrice_Dev\Sources\SharePrice\SharePrice.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(378,5): error MSB4018: at Microsoft.VisualStudio.SharePoint.Tasks.ValidatePackage.OnCheckParameters() [C:\BuildsNew\4\SharePrice\SharePrice_Dev\Sources\SharePrice\SharePrice.csproj]
Any help would be much appreciated.
We usualy see this error if you only reference the DLL's using the registry described in (http://msdn.microsoft.com/en-us/library/ff622991.aspx) and/or didn't install everything correctly. In our case installing SharePoint 2010 completely (without configuring it) on the buildserver removes this error.

How to create web deployment alone package using TFS

I just need to create Web Deployement package using TFS build and don't want to deploy it automatically in IIS.
I have added the below two parameters in Build Definition - > MSBuild Arguments
/p:CreatePackageOnPublish=true /p:DeployOnBuild=true
The probelm is I am not getting the ZIP file in drop location and getting the below error.
C:\Program
Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets
(1657): The "MapUriToIisWebServer" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x80005000): Unknown
error (0x80005000) at
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind() at
System.DirectoryServices.DirectoryEntry.get_IsContainer() at
System.DirectoryServices.DirectoryEntries.CheckIsContainer() at
System.DirectoryServices.DirectoryEntries.Find(String name, String
schemaClassName) at
Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.get_IisMajorVersion()
at Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.Execute() at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at
Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost
taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost
taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask,
Boolean& taskResult)
What could be the issue?
Now I am getting different error
error : Web deployment task failed.(Object of type 'manifest' and path 'e:\TFS\Dev\ApplicationName\Binaries\Release_PublishedWebsites\ApplicationName_Package\ApplicationName.SourceManifest.xml' cannot be created.)
error : Object of type 'manifest' and path 'e:\TFS\Dev\ApplicationName\Binaries\Release_PublishedWebsites\ApplicationName_Package\ApplicationName.SourceManifest.xml' cannot be created.
error : One or more entries in the manifest 'sitemanifest' are not valid.
error : Application '/ApplicationName' does not exist in site 'Default Web Site'.
I believe you just need to add the 'Package' target to your build for the web project.
/t:Build;Package
I've been using that target in my tfs build to generate the _PublishedWebsite folder with the package zip for a while now with success.
EDIT: Explanation of Package target
If you look at your csproj file for your web application as an XML file, you'll see that it includes the following
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
This includes a bunch of web targets into your build process. Crack this file open and at the bottom you'll see that it in turn includes
<Import Project="..\Web\Microsoft.Web.Publishing.targets" Condition="Exists('..\Web\Microsoft.Web.Publishing.targets')" />
This file contains the definition of the Web Deployment process for MSBuild. You'll see that it declares a variable to denote the "target" to invoke on a Deploy as being "Package"
<DeployDefaultTarget Condition="'$(DeployDefaultTarget)'==''">Package</DeployDefaultTarget>
If you read through this file further it will give you an idea of how Packaging and Deployment work under the covers and what the set of properties and targets are you can manipulate to customize your build.
Long story short though, if you call
msbuild yourwebapplication.csproj /t:Package /p:Configuration=Release
It should build you the web deployment package for the Release configuration of your app.
I had the same issue and the only thing that resolved it was this:
Open your IIS Management console
Go to your Default Web Site
Add new Application named 'ApplicationName'
Run msbuild again. It will work.
Possible duplicate of MSBuild DeployOnBuild=true not publishing
I had the same problem with Atlassian Bamboo, and this fixed it for me: From a machine with Visual Studio copy the contents of "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web" to the TFS Build server.

MSBuild with BizTalk failing

I am trying to set up a build server for BizTalk 2010 projects. I have installed the "Project Build Component" portion of BTS 2010 Enterprise only. However, I am getting the following error when trying to compile the solution:
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: File name: 'Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: at Microsoft.VisualStudio.BizTalkProject.Compiler.MapCompiler.Compile(BizTalkBuildSnapshot buildSnapshot, IEnumerable1 mapFilesToCompile, IEnumerable1 schemaFiles, List1& generatedCodeFiles, List1& xsltFiles) [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: at Microsoft.VisualStudio.BizTalkProject.BuildTasks.MapperCompiler.Execute() [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(115,9): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\Echo.BAS.TLAutoTender.Internal.Maps.btproj]
This error makes no sense. My understanding is that Visual Studio is no longer needed with the build components.
I would look at repairing the installation. You only need the build components and the SDK. Look here.
I will add the following to the previous answer, as my reputation at this point is < 50 and unable to add comments:
Microsoft Windows SDK for Windows 7 and .NET Framework 4 can be downloaded from here
Also please make sure your build command or build server is referencing MSBuild-32 bit (C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe) instead of 64 (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe)