Deploy from Visual Studio 2010 stopped working after upgrade to Web Deployment Tool 2.1 - msdeploy

I have a web site project that has been existing for a while - it has been ASP.NET MVC2 based up until right now. .Net 4, Visual Studio 2010 Sp1, deployed to IIS 7.5 running on Win2008 R2.
I have four separate deployment profiles - "alpha", "test", "staging" and "live". Yes, I could probably have come up with better names, but they should hopefully convey what they are for.
It was recently decided to upgrade to MVC3 to take advantage of new awesomeness like Razor, global filter attributes, and start using NuGet etc. So I went on an upgrade binge with the Web Platform Installer. One of the things I updated was the Web Deployment Tool - both my developer machine (where the MVC3 upgrade happens) and the web server got this new version of the tool installed.
Since then, I have not been able to do deployments. I have gone back to earlier versions of my project (thanks to git for allowing me to painlessly go back to any previous version) and tried to deploy them, and they don't work either.
Whenever I try to do a deployment from Visual Studio I get the following error:
Web deployment task failed.((23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.)
(23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.
Unable to cast object of type 'Microsoft.Web.Deployment.DeploymentSyncOptions' to type 'Microsoft.Web.Deployment.DeploymentSyncOptions'.
I can see why that cast would be hard. ;)
But seriously - how can we get deployment from Visual Studio to work again? In the future we will do this using our CI server, and install a deployment package using MsBuild automatically on the correct web server depending on the git branch that was updated, but that is some time in the future.
I have full access to both machines so any other information need can hopefully be gathered.

You might be having beta version of web deploy on your box if you have ever installed web platform installer v2 beta. YOu can check that by
gacutil -l Microsoft.web.deployment.
If you see any 7.5.0.0 version then you have a beta version. Uninstall this version. You need to check and change this on both the client as well as the server.

Owais is right - this is very likely because you have a pre-release version installed. Rune can you please check and let me know?

Related

Building MSI in azure devops

We have for a while been building various web projects with AzureDevops and self hosted build agents.
Today I had to add a new build, consisting of a windows service written in .net core 3.1. This service has to be installed by our customers, so we have to provide it in a friendly installable way. As some of our developers were already used to handle MSI/*.vdproj projects, they added a vdproj into the *.sln to manage that. On a developper machine, this is not a problem even with VS2019: you just have to use the relevant VS studio extension...
But when it comes to building that in a CI/CD context, this becomes a real challenge. I quickly understood that we can't use MSBuild at all for that and found some alternative using directly Visual Studio (devenv)... Inspired by this thread (still opened), I came up with the following command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv" [...]\MySolution.sln /build "Release" /Project MyInstallationProject
This worked fine both on my developer machine and even on the build agent machine. But when I add it into a build pipeline as a command line task, it seems to hang, and after a while I get the following result for the job:
##[error]The job running on agent <MyAgent> ran longer than the maximum time of 60 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=2077134
What can I do to make it work?
What are the best practices for generating a self installable in a CI/CD context? (Is MSI still relevant? )
As a workaround, you can try to install the extension Build VS Installer and use the task DutchWorkz - Build VS Installer(s) to build Visual Studio Installer Project in Azure Pipelines.
Here are some tickets(ticket1, ticket2) with similar issue you can refer to.

Azure .Net WebApp Deployment Failed but it works locally on VS

I am new to .Net and Unable to understand some weird behaviour with Azure.
I am trying to publish a .Net Project to Azure Web App. And It is throwing very silly errors. I assume thats becoz of new C# version.
Here is the log file.
Use Case 1: When trying to build from Visual Studio Team Services and then deploy using Continuous delivery Works.
Use Case 2: When trying to publish directly using Visual Studio using App Service profile and it works.
Use Case 3: When trying to deploy through repository that is hosted at Visual Studio Team Services. And it fails and thats the error.
Any lead will be helpful.
Do let me know, if the information provided is not enough.
To compile C# 7.0 code, we need msbuild 15 installed. Currently, msbuild15 is not enabled on Azure Web App.
For Use Case 1 and 2, the C#(7.0) code is build on your development side on which
Visual Studio 2017(msbuild 15) is installed.
For Use Case 3, the code will be complied on Azure Web App, so it will throw errors.
Microsoft engineers are in the process of building these tools for Azure, they should be out soon. you could stay updated on github

ASP.NET web app not deploying correctly on Windows server 2012

So here's the thing. I recently updated a web project to use nuget for its dependencies, which in turn updated all of those dependencies to the latest versions.
Quite a task as there were some breaking changes, but I have the thing running locally perfectly.
We use TeamCity to pull the solution from bitbucket and deploy it the the local iis folder on a development (staging) server.
After a build, the website seems very poorly, first off it complains:
Could not load file or assembly
'file:///C:\web\Dev.Pegfect.Presentation\bin\mscorlib.dll' or one of
its dependencies. An attempt was made to load a program with an
incorrect format.
Which is strange since my local copy does not have a copy of mscorlib in its web bin folder. Should be using the GAC? If I remove the dll, I get a new error (some NHibernate issue complaining about reflection). I haven't pursued that since it all seems environmental.
If I copy my local bin folder over the server web bin, it starts to run ok albeit extremely slowly (relative to how it used to).
So, the question "what have you tried" - i am currently installing VS 2012 onto the server and will try building the project from source directly. I am also considering updating TeamCity from v7 to v9.
I could also try to reinstall IIS8.0 on the server.
These are desperate, blind shots in the dark. What would you try?
FWIW the project is targeting .NET 4.5.1 (ANY CPU)
OK, so I will leave it here as it might help someone.
So, the project has been building, deploying and running successfully on the server compiled to .NET 4.5.1 with no problem.
The recent packages update moved us from MVC v4 to MVC v5. (amongst other things). Running .NET fix tool suggested 4.5.1 was corrupted, so I downloaded the developer version and installed and now its fine.

Cannot install Microsoft Web Farm Framework v2.2

Trying to install Microsoft Web Farm Framework v2.2 on a Windows 2008 server.
I've already downloaded and installed Web PI v3 after realising v4 is too new to be able to download the Web Farm Framework.
When I run the installer for the Web Farm Framework v2.2 I get the following error:
Web Deployment Tool is a pre-requisite for installing Web Farm Framework. Please install the Web Deployment tool.
The strange thing here is that Web Deploy is already installed (v3.0). So I then try and download v3.5 assuming there is a problem with the current version at v3.
However when I try to install this I get the following error:
Failed to instal Web Platform Installer. Lick OK to use the browser to download installer.
Can anyone help to get this working?
Not sure why it wants me to open another browser window since I just came from a browser to install the extension? So it seems I cannot install something because there is a dependency on something else, yet I can't install that dependency either.
Why is this so difficult and why hasn't Microsoft made this easier to install?
I got this working in the end. Basically you need to just install everything in sequence starting with the Web PI v3 then Web Deploy v2 followed by the Web Farm Framework. It seems there is a dependency on specific versions on each of the required tools. Not sure why it insists on opening a browser window again though.
I just encountered this issue and tried the registry modification which helped me out.
Try changing the registry setting install the module and change the registry back to the original value.
Open Regedit > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp
Edit "MajorVersion" and set the "HexaDecimal" value to 9
Install the WebFarm 2.2 module.
Change the "MajorVersion" back to "HexaDecimal" value of a
Hit F5 while in Regedit
Close Regedit

Web Deployment Projects - Remote IIS Server

Background
In the spirit of continuous integration, I'm trying to automate our deployment process using a Web Deployment Project. Mostly, this has been painless. Most options were baked in and those that weren't were easy to add through the MSBuild XML interface.
However, I cannot seem to find an option for deploying to a remote IIS Server. This seems strange to me because I obviously don't want all my builds to run on my production/staging server.
The Question
How can I set up my Web Deployment project to create/overwrite an IIS Virtual Directory on a remote machine?
Notes
I am using Visual Studio 2008 and .net 3.0.
[Edit]
As suggested by x0n below, I could use MS Deploy for this. I would rather use a Web Deployment Project though, especially since we already have those set up. :)
Your best bet is to take a look at MS Deploy which is available as a stand-alone package right now at RC level. It ships with a Go-Live license, which means it will be compatible with the version shipping with Visual Studio 2010. Some info:
http://blogs.iis.net/msdeploy/default.aspx
It's a great tool - will sync remote servers, farms etc picking up missing metabase info, com objects, registry, .net components in bin or gac, databases - the whole hog. It also ships with an interactive shell and powershell cmdlets.
-Oisin

Resources