ClickOnce Publish Error: "Cannot continue. The application is improperly formatted. Contact the application Vendor"

Publish fails with Error "Cannot continue. The application is improperly formatted. Contact the application vendor for assistance."
Consequently after the failure to publish, when the application is debugged from within the IDE there is an error

ArgumentNullException was unhandled Value cannot be null.

Call Stack:Parameter name: activationContext

at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)

at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

Cause

Cyclic dependencies caused due to having a reference to the same project under the references.

Resolution

Look under project references to verify that there are no Cyclic Dependencies.
Remove any Cyclic dependencies if exists.

 


Contributor: Aditya Hari
Reviewer : Ravi Shankar