How to safely deploy an ASP.NET server application together with a desktop client WinForms application - c#

I have an ASP.NET MVC 5 server application that works with SQL Server and that exposes some REST API for client consumption.
At the same time I have a Windows Forms application that consumes those REST services. The client application is being deployed through Click-Once.
Sometimes we make changes to the server that can break the client. It's not happening that often but it does happen from time to time.
I have been looking for a strategy to update both the client and server applications but so far I have not yet found a good one.
Ideally I'd like to do something along those lines:
Backup the database
Backup the server application
Backup the client application
Build the server application
Build the client application
Run the database migrations
Publish the server application
Publish the client application
If anything fails, rollback
Right now I'm doing all that by hand and it's tedious and prone to errors.
The migrations are being run through PowerShell using the commandlets of the EntityFramework (Database-Update)
The server and client code is being built on a dev box and published through the "Publish..." function of Visual Studio
There are many things that can go wrong.. migrations failing, timeouts during publishing, etc...
Ideally I could move the build and publish steps to one of the production boxes so that once the applications are being compiled and linked I can just copy the files over to the correct folders and restart IIS.
I would really love to get some suggestions to improve the flow and make it as automatic as possible. Cheers!

Related

is it possible to deploy c# mvc 5 with mysql database online

So i'm developing a project using c# mvc5 with mysql database.
I currently deploy my project in my local IIS. i also use xampp for my database
is it okay to have that set up or there will be a problem when i deploy it online
It should not be an issue at all. You just have to make sure when you publish it online you need to provide it with the correct connection details.
You will have to run a database that the production server can reach (could be on the same machine) and you will have to run the C# code in some way, but without more information about that I cant really say more about the production env, if its a windows server running IIS you could run it pretty much exactly as you do on the dev server.
Your development and production environments could look very different and it should not really affect the production environment in the end, but its always a good idea to run the development and production environment as similar as possible.

Work locally on ASP.NET web project hosted that is hosted on VPS

I am trying to learn how to use the ASP.NET framework; I'm already familiar with C# having already used it for desktop utilities a couple of times.
I have a hosted VPS that I want to host a project on, which I then want to work on from my local machine. I have tried using VSCode on my MacBook to work on the files before re-uploading them to the web server with SFTP, and then running the project server-side with dotnet run. This doesn't work, however, because it doesn't open port 5000 externally so I'm unable to view the project.
This probably just comes down to how much of a novice I am when it comes to ASP.NET. How do you or your organisation go about working on a project based on a server? Do I need to install the core on my local machine and run it locally before uploading changes back to the server with SFTP, or is there something I'm missing?

MVC Web Deploy with Entity Framework

I am trying to deploy my application that uses Entity Framework. When publishing, I use Publish Method set to Web Deploy to localhost (since I deploy it from the server). Then my Visual Studio asks me about Databases, so I point out the databases that the project uses (it is MSSQL Local DB and the other one is SQL Server DB). Whole publish works and and the connections are fine (as Visual Studio validates it). However, after publishing, the web application says:
Error.
An error occured while processing your request.
The application is already on server, seems fine, but whenever I try to access the database, this error shows up. What should I change?

How to move a WCF service layer from Azure to on-premises

Due to some (insane) limitation at my customer, I built up a WCF layer using Azure, just as a proof of concept. Now, what is a smooth way to re-deploy it to their on-premises server? Is there such a way?
I understand that the publishing of my service to the cloud is a nice luxury that can't be performed as easily when deploying on-premises. :(
Because of some (equivalently insane) limitations, I'm not able to connect my computer (with the IDE and source code) to the internal net of the customer. I might be able to get an IDE installed on their computer, though. Is moving the source code files and recompiling the only option?
In a perfect world, I'd like to copy the entire project to the customer's computer and just change some settings in a deployment file (or whatever thing stores that information). Is it possible?
Well, what about the deploying the solution to the local temp folder by using the Deploy Wizard from Visual Studio and then simply create by hands a new application on server side and copy all files there.

.net (winforms, not asp) multi-server deployment

I have a small .NET WinForms application, and couple of linux servers, DEV and CL1,CL2..CLN (DEV is development server and CL* are servers which belons to our clients, they are in private networks and it's a kind of production servers)
I want an update mechanism so that
(1) i develop a new version and publish it to a DEV
(2) users of DEV-server install latest version from DEV
(3) users of CL2 (employees of client2) install stable version from CL-2 directly
(4) application checks for updates using server it was installed from (so, if it was installed from CL-2, it should check CL-2 for updates)
(5) i should be able to propogate the update to a selected CL-server (using just file copy & maybe sed; not republishing), if i want that (and if i don't, that CL-server will have an old version until manually i update it)
I tried to use clickonce, but looks like it meets only first two requirements.
What should i do?
ClickOnce should handle 1-4 to be honest. All that would be needed is that for each site you want to deploy/update from, you'll need it to have its own publish, which after looking at your specifications is not incorrect to do.
What you could then do in order to make 5. applicable, is create an automated process to re-publish the file. This could perform a publish and then upload to the correct server.
Remember that ClickOnce needs a new manifest per version, and a new version requires a publish, so I'm not sure that you'll get around 5. with a simple file replacement.
Kyle is right. But for the 5th note, you just need to copy the deployment, and then use mage to modify the installation URL and point it to the new server, and then re-sign the manifests.
I support an app that we deploy to a DEV, QA, PROD servers. The way I handled this is that
I created created a cmd file that has command line calls to MSBUILD. It builds the app once for each server with the appropriate URLs and switches. I give my DEV and QA builds a different AssemblyName that way I can run all 3 environments side by side. This way my build process is automated and I don't have to publish at all.
Here's an article that describes the parameters you can use.
http://msdn2.microsoft.com/en-us/library/ms165431(VS.80).aspx
#Kyle,
For the above solution can the different versions run side by side or do you get errors indicating the app is already installed.

Categories

Resources