MSDeploy throwing MissingMethodException on EventWriteVerbose when trying to deploy package to IIS

1.1k views Asked by At

I am using Jenkins to build and package an ASP.NET project. Everything works well up until I attempt to run the <ProjectName>.deploy.cmd file that is output with the packaging process

This error is output whether I run the deploy.cmd or run msdeploy.exe directly

The missing method, apparently, is Microsoft.Web.Deployment.Tracing.WebDeployEventWriter.EventWriteVerbose(System.String, System.String, System.String)

The full output is:

Unhandled Exception: System.MissingMethodException: Method not found: 'Void Microsoft.Web.Deployment.Tracing.WebDeployEventWriter.EventWriteVerbose(System.String, System.String, System.String)'.

at Microsoft.Web.Deployment.TraceWrapper.EventWriteVerboseHelper(String message, String user, String siteName)
at Microsoft.Web.Deployment.TraceWrapper.EventWriteVerbose(String message, String user, String siteName)
at MSDeploy.MSDeploy.Main(String[] unusedArgs)

The arguments being passed to msdeploy.exe:

-source:package='C:\PROGRA~2\Jenkins\workspace\ProjectDirectory\Project.zip' -dest:auto,computerName="localhost",userName="Administrator",password="apassword",includeAcls="False",tempAgent="UseTempAgent" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\PROGRA~2\Jenkins\workspace\ProjectDirectory\Project.SetParameters.xml" -whatif

However, changing any of the arguments will result in the same output

3

There are 3 answers

0
Justin On

Although not exactly a fix, I downgraded to Web Deploy 3.0 and I do not see this error anymore and the project deploys successfully

0
Ram On

similar to @justin answer

downgrading to Webdeploy 3.5 instead of webdeploy 4.0 worked for me when i was using azuredevops

2
Hai Ha On

Like those above, for Windows 10 Enterprise, I had to downgrade to Web Deploy 3.5 to resolve this. I had to keep a copy of the Web Deploy 3.5 msi so that I can install it again, because some other apps (could be VS Code or some other VS products?) keep re-installing Web Deploy 4.0 when they do some upgrade.

Web Deploy 4.0 obviously doesn't work on my Windows 10 Enterprise. Even when I run msdeploy.exe without any parameter, the same error message above happens, so it's hopeless trying to resolve it.