COMException when generating ClickOnce manifest - visual-studio

During the build of my WPF project I sometimes get this error :
The "GenerateApplicationManifest" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x941270C0): Exception from HRESULT: 0x941270C0
at System.Runtime.InteropServices.UCOMITypeInfo.ReleaseTypeAttr(IntPtr pTypeAttr)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.ComImporter..ctor(String path, OutputMessageCollection outputMessages, String outputDisplayName)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.FileReference.ImportComComponent(String path, OutputMessageCollection outputMessages, String outputDisplayName)
at Microsoft.Build.Tasks.GenerateApplicationManifest.AddIsolatedComReferences(ApplicationManifest manifest)
at Microsoft.Build.Tasks.GenerateApplicationManifest.BuildApplicationManifest(ApplicationManifest manifest)
at Microsoft.Build.Tasks.GenerateApplicationManifest.OnManifestLoaded(Manifest manifest)
at Microsoft.Build.Tasks.GenerateManifestBase.BuildManifest()
at Microsoft.Build.Tasks.GenerateManifestBase.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) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
There is no syntactic error, the project should have compiled successfully.
Sometimes a Clean/Rebuild works, other times a restart of the Visual Studio will do the trick. Therefore I do have a
The only thing that I could isolate this issue to is the "Enable ClickOnce security settings" in the Security tab of the properties window of the WPF (startup) project.
Yes, the manifest for the ClickOnce deployment has to be generated, but why does it fail? The COMException and its HRESULT change their values at each build attempt.
Where should I start tackling this issue?

Related

Visual Studio 2019 Xamarin Dotfuscator CE Config File Creation Problem

I have followed the instructions at https://www.preemptive.com/dotfuscator/ce/docs/help/getting_started_xamarin.html#setup-targets and verified the accuracy multiple times. It says the first build will create DotfuscatorConfig.xml but it fails with Error 1. Then it says to set verbosity to Normal, so I did, but still no revelation why it won't create the file. I can change the build back to Debug and it builds fine, but changing back to release produces the same two errors. Has anyone experienced this and solved it?
Severity Code Description Project File Line Suppression State
Error The command ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe" /p:InDir="obj\Release\100\DotfuscatorXamarin\dfin",OutDir="obj\Release\100\DotfuscatorXamarin\dfout",ReportDir="DotfuscatorReports\Release" "obj\Release\100\DotfuscatorXamarin\Template.dfconfig" /in:+"${configdir}${InDir}\WetYourWhistle.Android.dll",+"${configdir}${InDir}\WetYourWhistle.dll" /makeconfig:"DotfuscatorConfig.xml"" exited with code 1. WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 508
Severity Code Description Project File Line Suppression State
Error The "_DotfuscatorXamarin_SetProjectPropsTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'C:\Users\leuol\source\repos\WetYourWhistle\WetYourWhistle\WetYourWhistle.Android\DotfuscatorConfig.xml'.
File name: 'C:\Users\leuol\source\repos\WetYourWhistle\WetYourWhistle\WetYourWhistle.Android\DotfuscatorConfig.xml'
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, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri)
at InlineCode._DotfuscatorXamarin_SetProjectPropsTask.Execute() in c:\Users\leuol\AppData\Local\Temp\r0wqtkdr\r0wqtkdr.0.cs:line 93
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 520
Error The command ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe" /p:InDir="obj\Release\100\DotfuscatorXamarin\dfin",OutDir="obj\Release\100\DotfuscatorXamarin\dfout",ReportDir="DotfuscatorReports\Release" "obj\Release\100\DotfuscatorXamarin\Template.dfconfig" /in:+"${configdir}${InDir}\WetYourWhistle.Android.dll",+"${configdir}${InDir}\WetYourWhistle.dll" /makeconfig:"DotfuscatorConfig.xml"" exited with code 1. WetYourWhistle.Android C:\Users\leuol\source\repos\WetYourWhistle\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets 508
UPDATE - Now the code is compiling without error but still will not produce the DotfuscatorConfig.xml file. Not sure what else to try and it appears that nobody else knows either.
The solution is to temporary change the command dotfuscator.exe to dotfuscatorUI.exe :
<PropertyGroup>
<DotfuscatorXamarinConfigFileName>DotfuscatorConfig.xml</DotfuscatorXamarinConfigFileNam
<DotfuscatorXamarinCliPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscatorUI.exe</DotfuscatorXamarinCliPath>
<DotfuscatorGenerateConfigFileIfMissing>true</DotfuscatorGenerateConfigFileIfMissing>
<DotfuscatorEnabled>true</DotfuscatorEnabled>
<DotfuscatorXamarinEnabled Condition="'$(Configuration)' == 'Release'">true</DotfuscatorXamarinEnabled>
</PropertyGroup>
<Import Project="../../PreEmptive.Dotfuscator.Xamarin/PreEmptive.Dotfuscator.Xamarin.targets" />
Then start build. The dotfuscator UI starts with a window:
Show Image
Then press "Build". After it finishes, close then window by clicking "x" on top right. Then the output on Visual Studio shows a successful result:
Build started: Project: [AppName].Android, Configuration: Release Any CPU ------
[AppName].Android -> D:\Users\[UserName]\source\repos\[FolderName]\[AppName]\[AppName].Android\bin\Release\[AppName].Android.dll
Running Dotfuscator with a new config file based on project references...
Finished running Dotfuscator with a new config file.
D:\Users\[UserName]\source\repos\[FolderName]\[AppName]\[AppName].Android\[AppName].Android.csproj : warning : A new Dotfuscator config file was generated because it did not exist: 'DotfuscatorConfig.xml'.
You can see dotfuscatorconfig.xml is created at a folder [AppName].Android.
Then revert back from dotfuscatorUI.exe to dotfuscator.exe .
<PropertyGroup>
<DotfuscatorXamarinConfigFileName>DotfuscatorConfig.xml</DotfuscatorXamarinConfigFileNam
<DotfuscatorXamarinCliPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe</DotfuscatorXamarinCliPath>
<DotfuscatorGenerateConfigFileIfMissing>true</DotfuscatorGenerateConfigFileIfMissing>
<DotfuscatorEnabled>true</DotfuscatorEnabled>
<DotfuscatorXamarinEnabled Condition="'$(Configuration)' == 'Release'">true</DotfuscatorXamarinEnabled>
</PropertyGroup>
<Import Project="../../PreEmptive.Dotfuscator.Xamarin/PreEmptive.Dotfuscator.Xamarin.targets" />
Then the build should work without a UI popup.

MSB3322 on signing assembly on Visual Studio for Mac with pfx

On Visual Studio for Mac 7.1, I am trying to build a project that builds fine on Visual Studio 20176 Update 3.
The first error on a project file is:
Target ResolveKeySource:
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3103,5): error MSB3322: Unable to get MD5 checksum for the key file "../xxx.pfx". Could not find file "/Users/PATH/xxx.pfx".
Done building target "ResolveKeySource" in project "yyy" -- FAILED.
The pfx actually exists and is readable.
With more logging enabled, it reads:
error MSB4018: The "ResolveKeySource" task failed unexpectedly.
error MSB4018: System.NotSupportedException: Specified method is not supported.
error MSB4018: at System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject (System.Guid clsid, System.Guid riid) [0x00006] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs:204
error MSB4018: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
error MSB4018: at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
I've been playing around with changing the file format for signing, but would like to have one solution that builds easily on Windows and Mac.
Is there a solution with one file format for signing the assemblies?
I just recompiled some old signing-based Xamarin.Android apps w/ the latest Xamarin versions using msbuild/csc and .pfx just do not work (unless there is some magic I am missing).
But converting the .pfx to a .snk to extract the public key worked fine, use the mono version of "StrongName utility for signing assemblies" (sn) on macOS:
sn -p certificate.pfx certificate.snk
It will prompt you for the password, use the resulting .snk file instead. The .snk file will work fine on Windows also.

MonoDevelop.AddinMaker - 'MonoDevelop.Core,5.10' is disabled

I am working on an MonoDevelop Addin (using MonoDevelop.AddinMaker) within Tamarin Studio and MonoDevelop and everything was fine, till I needed to access the GTK# Toolbox to fix some existing GUI panels (originally from the CSharpBinding GUIs).
The GTK# Widget that is referenced in those panels are in MonoDevelop.Ide.dll, so I added that to the GTK# ToolBox and the widgets show up. But the build generates invalid partial classes due to missing widget reference (MonoDevelop.Ide) and that reference is not available via the AddinMaker's Addin References system so I added a manual assembly reference to MonoDevelop.Ide.dll.
Now the debugging of the Addin fails with:
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Ide,5.10): Add-in could not be loaded: The required addin 'MonoDevelop.Core,5.10' is disabled.
Mono.Addins.MissingDependencyException: The required addin 'MonoDevelop.Core,5.10' is disabled.
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 597
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 612
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Core,5.10): Disabled add-ins can't be loaded.
Loaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll [External]
Thread started: #3
Unloaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll
Thread finished: #3
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/WebCredentialProviders
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 636
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 607
at Mono.Addins.AddinManager.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 630
at MonoDevelop.Core.WebRequestHelper.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs:line 49
at MonoDevelop.Core.Runtime.Initialize (Boolean updateAddinRegistry) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:line 118
Starting Xamarin Studio
FATAL ERROR [2015-11-22 11:47:42Z]: Xamarin Studio failed to start. Some of the assemblies required to run Xamarin Studio (for example gtk-sharp)may not be properly installed in the GAC.
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/PlatformService
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path, System.Type arrayElementType, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 669
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 534
at Mono.Addins.AddinManager.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 554
at MonoDevelop.Ide.DesktopService.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs:line 56
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 175
at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 652
I removed the assembly reference, removed the GTK Toolbox MonoDevelop components/widget, etc.. but the problem persists.
MonoDevelop and Xamarin Studio run fine by themselves, so how do I re-enable(?) the MonoDevelop.Core addin in the AddinMaker Project?
I would try deleting the addin-db-002 directory (might be called
something different) which is inside the directory of your addin's
bin/Debug directory. – Matt Ward
That was actually the problem, the addin-db-002 does not cleaned up on a Clean All, nor does it get a complete update on a Build All.
So once you have a 'corrupt' list of addin's within the sub-dir of ./addin-data/1 they do not get re-created unless you manually delete the addin-db-002.

Running websharper.ui.next on OSx complains with a mcs error

I've got a websharper project that runs flawlessly on windows. However it only compiles flawlessly on mac but can't be run. The webserver complains that it can find a file (doesn't name it) and reading the stacktrace it seems to be the C# compiler complaining. However being an F# project that's somewhat surprising.
System.SystemException
Error running mcs: Cannot find the specified file
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.
Exception stack trace:
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00135] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:216
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00011] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:136
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00014] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs:111
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x002e8] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:822
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:731
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00264] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:826
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x0011c] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:451
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00056] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:396
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00040] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:989
at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:972
at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x0016b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs:417
ANy suggestions to what could be the root of this problem?
Seems like a mono installation issue. A similar exception is happening in this ticket: https://forums.xamarin.com/discussion/50713/error-running-mcs-cannot-find-the-specified-file
Upgrading to mono 4.2 alpha resolves the issue. I do however think it can be solved with 4.0 as well since I have had the same web site running on a different Mac without installing 4.2

Windows Azure Training Kit Guestbook Demo get error when building

This is the error i receive when i build the GuestBook demo. Does anyone have any idea what would be causing this? I'm assuming something got installed wrong but i can't figure out what. I'm also assuming it has something to do with MSBuild.
Error 1 The "DeleteCurrentDeployment" task failed unexpectedly.
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6D5140C1-7436-11CE-8034-00AA006009FA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
at Microsoft.VisualStudio.OLE.Interop.IServiceProvider.QueryService(Guid& guidService, Guid& riid, IntPtr& ppvObject)
at Microsoft.VisualStudio.Shell.ServiceProvider.GetService(Guid guid, Type serviceType)
at Microsoft.VisualStudio.Shell.ServiceProvider.GetService(Type serviceType)
at Microsoft.Cct.IServiceProviderExtensions.GetService[InterfaceType,ServiceType](IServiceProvider serviceProvider)
at Microsoft.Cct.CctBuildDeploymentTaskHost.DeleteCurrentDeployment()
at Microsoft.CloudExtensions.MSBuildTasks.DeleteCurrentDeployment.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)
I found the solution in this site
http://consultrikin.wordpress.com/2013/04/11/the-deletecurrentdeployment-task-failed-unexpectedly/
Solution:
Make sure you have installed every component for Windows Azure. http://www.microsoft.com/en-in/download/details.aspx?id=35448 This particular error says that the system is missing Windows Azure Emulator.
It seems that the build tries to delete an existing azure deployment, but fails doing so. Please make sure, that the current Azure SDK is installed correctly.
http://rduclos.wordpress.com/2011/02/25/the-deletecurrentdeployment-task-failed-unexpectedly-and-ie8-tab-hang/
Solution
Install the SourceGear Vault client v3.1.9 in “C:\Program Files (x86)\SourceGear\Vault Client”
Backup all files and folders from the folder “C:\Program Files (x86)\SourceGear\Vault Client” to a backup folder “C:\Program Files (x86)\SourceGear\Vault Client Backup”
Uninstall the SourceGear Vault client v3.1.9
Restore all files and folders from the “C:\Program Files (x86)\SourceGear\Vault Client Backup” to the “C:\Program Files (x86)\SourceGear\Vault Client”
Create a FixSourceControlProviderOnWin7x64.reg file and paste the following values:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceCodeControlProvider]
"ProviderRegKey"="Software\SourceGear\Vault Client"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceCodeControlProvider\InstalledSCCProviders]
"SourceGear Vault Client"="Software\SourceGear\Vault Client"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceGear]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SourceGear\Vault Client]
"SCCServerName"="SourceGear Vault Client"
"SCCServerPath"="C:\Program Files (x86)\SourceGear\Vault Client\VaultIDE.dll"
Run the FixSourceControlProviderOnWin7x64.reg file.

Resources