Getting error on creating deployment using MageUI - c#

I need to change a database configuration in app.config.exe in a one click application.
I looked up several information in creating the deployment in MageUI.
http://danielbergsten.wordpress.com/2010/12/21/change-application-configuration-in-an-already-published-clickonce-app/
http://community.discountasp.net/showthread.php?t=14370
https://stackoverflow.com/questions/7082410/clickonce-setup-exe-fails-but-the-application-file-works-fine-when-using-a-wind
I found this link to seem the most direct but I did not get rid of my error from following this link either.
ClickOnce and mageUI adding custom file folder problems.
Actually this is exactly what I am looking for in a solution except the solution in the link given did not work for me.
I)
I tried several combinations to see if it would work.
1) sign manifest in application version folder . (.manfest file)
2) sign application deployment in root folder and using newly signed manifest (.application)
3) copy it over to application version.
II)
1) sign manifest in application version folder . (.manfest file)
2) sign application deployment using new manifest.
3) copy application deployment to application version and then sign it again using new manifest in application folder.
III)
1) sign manifest and check add .deploy.
2) sign application deployment in root folder.
3) copy application deployment to application folder.
I am not getting any luck in resolving the error I am getting.
The error I get is when I try running the one application from DEV web server environment is. I get a 404 error and the config file is not found.
If I publish the application from VS it works good.
The issue is I need to change only a production database value and I do not want to publish from VS2010 and Ijust want to use the .exe and config directly from production and just change the config and resign everything using the MageUI. I am trying to do the resign on DEV environment to see if the resigning works when deployed to DEV so I could do the same steps on production. DEV deployment after resigning FAILS.
Please do not suggest mage becuase I am just not able to run mage as a command line though I would like to know how I can do it. I tried that and I get mage not found but MageUI works good.
I am not sure what step I am missing here.
Here is the full error stack trace when I try opening this one click application link using the webserver where I deployed it to.
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.17929
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.17929 built by: FX45RTMREL
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
Application url : http://dev/pfs/priority/DEV/Application%20Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.manifest
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
IDENTITIES
Deployment Identity : PriorityWinApp-DEV.application, Version=1.0.3.128, Culture=neutral, PublicKeyToken=2c3d7f3ec71aa887, processorArchitecture=msil
Application Identity : PriorityWinApp-DEV.exe, Version=1.0.3.128, Culture=neutral, PublicKeyToken=2c3d7f3ec71aa887, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
* Online only application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application resulted in exception. Following failure messages were detected:
+ Downloading http://dev/pfs/priority/DEV/Application Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.config did not succeed.
+ The remote server returned an error: (404) Not Found.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [5/26/2013 12:22:07 PM] : Activation of http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application has started.
* [5/26/2013 12:22:07 PM] : Processing of deployment manifest has successfully completed.
* [5/26/2013 12:22:07 PM] : Installation of the application has started.
* [5/26/2013 12:22:07 PM] : Processing of application manifest has successfully completed.
* [5/26/2013 12:22:09 PM] : Found compatible runtime version 4.0.30319.
* [5/26/2013 12:22:09 PM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [5/26/2013 12:22:10 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://dev/pfs/priority/DEV/Application Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.config did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- The remote server returned an error: (404) Not Found.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

Related

.exe file not recognized after resigning the manifest on ClickOnce Publish

I am using MVS 2015 with .Net Framework 4.5.
I publish my C# WF Application, everything is fine, but I have to obfuscate the .exe from Application Files.
After I do it, obviously, the setup does not recognize anymore the .exe, the hashes are different and so on.
I resign the new .exe added file with Signtool providing the necessary .pfx and password, then I use Mage to update the .manifest and the .application according to the second part of this MSDN documentation.
Everything is successful, but when I run the setup and I hit install, after a while (around 80% of the installation progress) I receive an error that says that there is something wrong with the new .exe file:
PLATFORM VERSION INFO
Windows : 10.0.16299.0 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.7.2556.0 built by: NET471REL1
clr.dll : 4.7.2633.0 built by: NET471REL1LAST_C
dfdll.dll : 4.7.2556.0 built by: NET471REL1
dfshim.dll : 10.0.16299.15 (WinBuild.160101.0800)
SOURCES
Deployment url : file:///E:/share/myApp.application
Application url : file:///E:/share/myApp.exe.manifest
IDENTITIES
Deployment Identity : myApp.exe.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil
Application Identity : myApp.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of E:\share\myApp.application resulted in exception. Following failure messages were detected:
+ Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
+ Cannot load internal manifest from component file.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [24.03.2018 11:03:32] : Activation of E:\share\myApp.application has started.
* [24.03.2018 11:03:32] : Processing of deployment manifest has successfully completed.
* [24.03.2018 11:03:32] : Installation of the application has started.
* [24.03.2018 11:03:33] : Processing of application manifest has successfully completed.
* [24.03.2018 11:03:35] : Found compatible runtime version 4.0.30319.
* [24.03.2018 11:03:35] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [24.03.2018 11:03:43] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
- Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
What am I doing wrong? What am I missing? :(
I have investigated Marko application, and if you have in use .NET Refactor and have a problem from above here is workaround for get it working:
.Net Reactor has a Visual Studio Add-In that needs installed and configured in the project
Anti ILDASM from .Net Reactor (option that's enabled by default) has to be disabled when obfuscating so that MVS could do the proper packing process
Anyway, if you gonna modify your assemblies after publish you need to recompute hash anyway. How it's possible:
Don't use a Visual Studio publish engine and generate you
application by "mage.exe". It's let to you prepare you source
application first and create ClickOnce application after.
Download utility from second download link [here]. Execute and [Choose] your folder > Change action to [Update] > and [Build]. No more actions required. Update operation will recompute hashs.
If your obfuscator software supports command line parameters then you can add "Post-build event" script in your .exe VS project properties and it will be executed before clickonce build.
"Deploying Obfuscated Assemblies" article you can found here: Securing ClickOnce Applications

ClickOnce won't run - Getting 'Specified Cast Not Valid'

I have a C# app that we deploy on Win7 machines (using ClickOnce) without any issues (for years now) but we have a few employees with a Surface Pro 2 (8.1) and the app won't install. When they run the setup.exe they get the standard "contact your administrator for details" error. Here's the log that it produces:
PLATFORM VERSION INFO
Windows : 6.2.9200.0 (Win32NT)
Common Language Runtime : 4.0.30319.34014
System.Deployment.dll : 4.0.30319.33440 built by: FX45W81RTMREL
clr.dll : 4.0.30319.34014 built by: FX45W81RTMGDR
dfdll.dll : 4.0.30319.33440 built by: FX45W81RTMREL
dfshim.dll : 6.3.9600.16384 (winblue_rtm.130821-1623)
SOURCES
Deployment url : file://asc-server/public/Programs/Installs/SCS/SCS.application
Deployment Provider url : file://asc-server/public/Programs/Installs/SCS/SCS.application
Application url : file://asc-server/public/Programs/Installs/SCS/Application%20Files/SCS_3_4_0_9/SCS.exe.manifest
IDENTITIES
Deployment Identity : SCS.application, Version=3.4.0.9, Culture=neutral, PublicKeyToken=cc0fb6e85ade2b56, processorArchitecture=x86
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of \\asc-server\public\Programs\Installs\SCS\SCS.application resulted in exception. Following failure messages were detected:
+ Specified cast is not valid.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [6/18/2014 8:19:42 AM] : Activation of \\asc-server\public\Programs\Installs\SCS\SCS.application has started.
* [6/18/2014 8:19:42 AM] : Processing of deployment manifest has successfully completed.
* [6/18/2014 8:19:42 AM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [6/18/2014 8:19:42 AM] System.InvalidCastException
- Specified cast is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.VerifyRequestedPrivilegesSupport(String requestedExecutionLevel)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I see that it says "Specified Cast is not Valid" but I'm not too sure why we're getting that error. I've tried the following so far (with no luck):
Changed Target CPU from x86 to Any CPU
Changed signing from sha1RSA to sha256RSA
Ran setup.exe as Administrator
Turned off all UAC
Created a basic windows form (1 form, 1 button) and tried to install, but getting same error.
Latest - I took the .exe from the basic windows form app and ran it on the Surface Pro, which it runs fine, so I'm thinking it must be a setting issue.
At this point I'm thinking it's a setting either with the Surface Pro OR a VS deployment setting that I'm missing.
Any ideas or suggestions are greatly appreciated!
This was caused because of the Users security settings.
if you select it as in the picture problem is solved automatically. and you may continue installing.
if you cannot see the picture in the link above;
open Control Panel -> User Account Control Settings
adjust the slider 2nd from top. (Notify me only when the apps try to make changes to my computer (default)

Clickonce installation fails to download

I had made a Clickonce deployemnt to my application set the installation folder and publishing folder the same that is a network share and then it work perfect for my development machine
Then when I went to on client machine opened the network share and I tried to install the application using that setup file i got tht message like below
And in details Iam getting the below message
LATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.586
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.586 (RTMLDR.030319-5800)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file://it-dept/Project/mycutorderlast/CutorderFresh.application
Deployment Provider url : http://it-dept/CutorderFresh/CutorderFresh.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of \\it-dept\Project\mycutorderlast\CutorderFresh.application resulted in exception. Following failure messages were detected:
+ Downloading http://it-dept/CutorderFresh/CutorderFresh.application did not succeed.
+ The remote server returned an error: (404) Not Found.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [08/10/2013 14:03:25] : Activation of \\it-dept\Project\mycutorderlast\CutorderFresh.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [08/10/2013 14:03:30] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://it-dept/CutorderFresh/CutorderFresh.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- The remote server returned an error: (404) Not Found.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Can anyone suggest what was the issue As Iam using clickonce for the first time
Check values of 'Publish Location' or 'Installation URL' on Publish tab of properties. According to your current settings, you should have published files accessible by this path: http://it-dept/CutorderFresh/CutorderFresh.application and it looks like they're not available by this path.
Here you can read how to set proper 'Publish Location' and 'Installation URL' values
I had this same issue and it was driving me mad. I knew I had the proper permissions set up on the network's shared folder. I couldn't even install my application from my own machine via the network share. After searching long and hard for an answer I figured it out myself.
On the Publish tab of properties I only filled in the "Publishing Folder Location" with:
\servername\share\Application Folder
I left the "Installation Folder URL" section blank.
Somehow a field in the "Application Updates" section (via clicking "Updates" button on Publish tab) got filled in with a different value than what my network share was. Not sure if I did this myself or if it was set by default. I cleared out the "Update Location (if different than the publish location)" field and that fixed this issue for me. Here is a screen shot of where I changed the field:
I would post a screen shot of the form that was causing me trouble but for some reason I need 10 reputation points to post a picture.
I resolved my problem like yours.
I don't know that "Publishing Folder Location" of my application (below "formtest" App.) is different from "Installation Folder URL".
In fact, two folders of former WEB server for click once deployment were not different. So, I was confused after WEB server was changed.
Publishing Folder Location: \12.39.526.272\root\formtest\
Installation Folder URL: http://12.39.526.272:8080/formtest/
Application Updates section "Update Location (if different than the publish location)" field : http://12.39.526.272:8080/formtest/
I'm so sorry My native language is not English.
I had the same error, but resolved it a different way. Somehow I had accidentially unchecked something in the Options.
On the Publish tab, select "Options". Under Deployment, make sure "Use .deploy file extension" is checked. Once I checked that and republished, the error went away.

Webdeploy permission issue

I have 3 web deploy (visual studio publish project to package) packages for which I use msdeploy command to sync with a server. One of the package was newly added. The other two packages work fine except for the newly added one. I see the following error in the log. I am not sure where to set the permission for this since the permissions for iisApp provider are already set in IIS Manager Delegation settings. I am new to IIS configuration and .net development. Can anyone provide info on why I am getting this error?
Here is the command used:
PS D:\Deployment> &'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' -verb:sync -source:package='D:\temp\CI.Web.Pack_20130824.1\_PublishedWebsites\ProjectXYZ_Package\
ProjectXYZ.zip' -dest="auto,computerName='https://localhost:8172/msdeploy.axd?site=siteName',username
='deployUserName',password='deployPassword',authType=basic,includeAcls='False'" -skip:objectName=createApp -disableLink:AppPoolExtens
ion -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted
Info: Using ID '2b0c6151-a2b0-4a87-9135-263330c5e619' for connections to the remote server.
Info: Object createApp (D:\Builds\2\Mayo.KCMS\CI.Web.Pack\Sources\DEV\Web\ProjectXYZ\obj\Rele
ase\Package\PackageTmp) skipped due to skip directive 'CommandLineSkipDirective 1'.
Info: Adding sitemanifest (sitemanifest).
Info: Adding IIS Application (Default Web Site/ProjectXYZ_deploy)
Error Code: ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP
More Information: Could not complete an operation with the specified provider ("iisApp") when connecting using the Web M
anagement Service. This can occur if the server administrator has not authorized the user for this operation. iisApp htt
p://go.microsoft.com/fwlink/?LinkId=178034 Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_
AUTHORIZED_FOR_IISAPP.
Error count: 1.
Error on server:
wmsvc.exe Error: 0 : User:
Client IP: ::1
Content-Type: application/msdeploy
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1631.0
MSDeploy.Method: Sync
MSDeploy.RequestId: 6b694745-0024-416c-9439-3e97608417b9
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
ServerVersion: 9.0.1631.0
Skip: objectName="^configProtectedData$"objectName="createApp"
Provider: auto, Path:
A tracing deployment agent exception occurred that was propagated to the client. Request ID '6b694745-0024-416c-9439-3e97608417b9'. Request Timestamp: '8/26/2013 2:01:55 PM'. Error Details:
ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP
Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Could not complete an operation with the specified provider ("iisApp") when connecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this operation. iisApp http://go.microsoft.com/fwlink/?LinkId=178034 Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP.
at Microsoft.Web.Deployment.DelegationHelper.ImpersonateForOperation(String deploymentAction, String deploymentProvider, String deploymentPath, DelegationContextCache cache)
at Microsoft.Web.Deployment.DelegationHelper.ImpersonateForOperation(String deploymentAction, DeploymentObject deploymentObject)
at Microsoft.Web.Deployment.DeploymentObject.Add(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
I have found the solution for the problem. The third package was trying to create a new application on the server because of a different application name than the other two packages. I have added a new setParameters.xml file that has entry for the application name which will overwrite the default application name with the one the previous two packages were deploying to. I pass this setParameters.xml file as a parameter to the Webdeploy command.
&'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' -verb:sync -source:package='D:\temp\Project_XYZ.zip' -setParamFile:setParameters.xml -dest="auto,computerName='https://localhost:8172/msdeploy.axd?site=siteName',username='deployUser',password='changeMe',authType=basic,includeAcls='False'" -skip:objectName=createApp -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -whatif
setParameters.xml
<?xml version="1.0" encoding="utf-8"?>
<parameters>
<setParameter name="IIS Web Application Name" value="siteName" />
</parameters>
Unless the user is an administrator, you need to grant them access to deploy to the website. You can do so by right clicking on the website in IIS Manager and select Deploy :: Configure Web Deploy Publishing. Just select the user and click OK (you can delete the publish settings file it generates on the desktop)
I had this exact problem, when I went to the non-admin deploy. This is a working command line after getting the 'ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP' error. This eliminates the need for referring to the external setParams.xml, by using -setParam
Sadly it is the double reference to the 'sitename' in the setParams and in the computername string that makes this work. I tried eliminating one or the other, but I would always get the 'ERROR_USER_NOT_AUTHORIZED_FOR_IISAPP' error.
`"c:\program files\iis\microsoft web deploy v3\msdeploy" -verb:sync -setParam:'IIS Web Application Name'='sitename' -source:package="package.zip" -dest:auto,computerName='https://machinename:8172/msdeploy.axd?site=sitename',username=username,password=password, -allowUntrusted=true`
I fixed this by uninstalling and then re-installing Web Deploy (both via running the Web Deploy installer).
See this question and its answers for what seems like the same, or at least a similar, issue:
asp.net - Error: "The configuration section 'system.webServer/management/delegation' cannot be read because it is missing schema - Stack Overflow

Application cannot be started error in ClickOnce deployment

I have an application created in Visual C# using ClickOnce.
I send this application to users via a zipped ClickOnce publish folder, however I (the developer) cannot install it, while others have no problems.
I do the following steps:
- In VS 2010, Project settings, Publish tab, click button 'Publish Now'
- In the created directory I run setup (this is the created ClickOnce Setup file)
- I get the error dialog: Application cannot be started. Contact the application vendor.
Btw, I have not signed my application and assigned the application as a Full Trust application.
What I already tried (also according comments):
- When run as administrator (RMB on setup in clickonce in local folder), I get the same error.
- When running it directly from the bin directory, it works ok.
- When adding a sleep for attaching a debugger, it immediately gives the same error.
- I cleared the cache but it does not help.
And below are the complete details:
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.261
System.Deployment.dll : 4.0.30319.245 (RTMGDR.030319-2400)
clr.dll : 4.0.30319.261 (RTMGDR.030319-2600)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///D:/PcgTools%20Publish2/PcgTools.application
Application url : file:///D:/PcgTools%20Publish2/Application%20Files/PcgTools_0_5_0_149/PcgTools.exe.manifest
IDENTITIES
Deployment Identity : PcgTools.application, Version=0.5.0.149, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of D:\PcgTools Publish2\PcgTools.application resulted in exception. Following failure messages were detected:
+ Specified cast is not valid.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
* The manifest for this application does not have a signature. Signature validation will be ignored.
* The manifest for this application does not have a signature. Signature validation will be ignored.
OPERATION PROGRESS STATUS
* [12-3-2012 2:18:04] : Activation of D:\PcgTools Publish2\PcgTools.application has started.
* [12-3-2012 2:18:04] : Processing of deployment manifest has successfully completed.
* [12-3-2012 2:18:04] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [12-3-2012 2:18:04] System.InvalidCastException
- Specified cast is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.VerifyRequestedPrivilegesSupport(String requestedExecutionLevel)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

Categories