I have been doing some work recently with publishing mvc applications on visual studio 2012. I have been using publish profiles to configure web deploy to different environments. I have also been using web transforms to transform my web.config as per each of my publish profiles.
For each of my target environment, I have web deploy and package publish profile. So dev has 2, qa has 2 etc. This is to give me the option to either web deploy or package up. Is there any way that I can just have the web deploy profile and after I web deploy, the package also gets created and placed on disk? So I only need the one publish profile per environment.
If 2 publish profiles are needed per environment, can I consolidate the transform in to one transform file instead of having a transform for each profile - as the transform is identical as the target environment is the same.
Related
We are building a webapp for our clients using ASP.NETZero template built on dotnet core 3.1.x
I am trying to create release pipeline in Azure DevOps and facing issues while publishing the changes of build pipeline to IIS similar way I did for traditional MVC5 or MVC6 .NET Framework based webapps.
The self-hosted devops agent is running on a different machine than production server where the webapp is published and the agent service account has access of the shared path of the \\server\inetpub-sharedhostingdir only.
Traditoinally, Copy Files task could replace app DLLs and all other files but in .NETCore there is an error like below:
Then I found out that this is because of changes how .NET Core 3.1.x hosting works.
I also tried to use 'OutOfProcess' in the web.config in the webapp but still getting same error and then I found this SO post and DLL hotswap info given by #MindingData.
So, my current bat to overcome this issue is using remote powershell in CD; I can stop the webapp and publish the new artifact. But there is cost for this step, I have to stop the site and replace all the DLLs which may roughly takes 30 seconds.
The remote Azure DevOps agent does not have access to do so right now and yet we have to add firewall exceptions to do so.
I am wondering if there is any other efficient alternative to publish .NETCore 3.1.x webapp using AzureDevOps agent running on a remote server? (as access of production server is restricted and we cannot deploy the azure agent on production machine.)
Because of these issues currently I need to move all the DLLs in 'backup' directory manually to make the hosting directory empty and then if I run the pipeline of first image, the 'Copy Files To' runs successfully and publishes the app well.
Any suggestions for improving the CD in current environment?
You may try using 'app_offline.htm' file for graceful shutdown of your running application and after deployment you can easily remove that file using powershell command task.
This approach should work as you have access of the deployment directory of the remote server. Steps are mentioned on the SO post.
I have a number of services which run via IIS and that are worked on daily. On my local machine these are run via IIS. When I was using .NET Framework this was easy, I would point to the source folder and it just worked. Now with .NET Core I must manually "publish" every time I make a change. Is there some way to automatically publish when I build or when changes are made?
You can create an Azure Devops (VSTS) account and configure build and release triggers.
This will basically pull your repository every-time you push to certain branch and then follow the build and release process you configured to deploy your solution to your IIS.
Here is a link with some more details to help you : https://medium.com/#taithienbo/build-and-deploy-an-asp-net-core-app-running-on-iis-using-azure-pipelines-e675041f62d4
I am using Teamcity as my continuous integration server.
I have a Visual Studio project which needs to be deployed to IIS as a new application in default website in a remote Windows server.
How can I achieve this , either from command line or from any one of the Teamcity build runners.
I am new to this and have no idea of what to do. Please help me out.
JetBrains provides documentation for this scenario.
In a nutshell:
Configure web.config transforms to modify application settings based on your target environment (i.e. your test/prod DB connection strings)
Enable WebDeploy on the IIS server (for automated delivery of the site package to IIS)
Set up TeamCity build step to WebDeploy your project to IIS.
I have several build definitions setup in TFS 2012. They all use Web Deploy and Web Packages and deploy to my dev and test servers and work just fine.
I can't, however, figure out what the "deployed" tab in TFS Web Access > Builds is used for?
The 'deployed' tab seems to be related to Azure integration somehow.
I found this post on the TFS Deployer website. It's even possible to mark a build as 'deployed' via PowerShell, which seems quite interesting. It would be nice to have our deployed builds showing in that tab, and by integrating with TFS Deployer this seems possible.
I'm trying to deploy a simple Hello World ASP.NET MVC 4 app to an free tier EC2 instance using elastic beanstalk. I'm using Visual Web Developer Express (2010) which doesn't support the AWS Toolkit extensions, so how do I deploy the site without the extension?
It seems that with the Elastic Beanstalk web console, you can upload a file as a new applicaiton. But I can't figure out what's supposed to be in the file. Is it a zip containing a published mvc app? I tried that, and when navigating to the instance after it loaded it just displayed the IIS 8 logo. There's a sample zip on a walkthrough page, but it's an old ASP.NET page with 3 xml files in the root. I have no idea what to change in those files for MVC, .NET 4, Server 2012, or IIS 8. I can't find this information anywhere.
I tried creating some EC2 instances manually, remoting in and deploying the site myself. However the free Windows Server 2008 images don't have .NET 4. And the free Windows Server 2012 image doesn't have IIS... I couldn't figure out how to actually deploy my site.
The command line tool that's called by the AWS Toolkit extension can be used manually. Here is the documentation I found on deploying using this tool.
You have to publish your site as a Web Deploy Package in Visual Studio. Then use the tool located in Windows by default at
C:\Program Files (x86)\AWS Tools\Deployment Tool>awsdeploy.exe
You have to pass it a text file that contains the deployment configuration. There's a template for the file at
C:\Program Files (x86)\AWS Tools\Deployment Tool\Samples\ElasticBeanstalkDeploymentSample.txt
The first time I used the tool, deploying the package archive generated by Visual Studio, I still got the plain IIS 8 landing page. However, when I did an incremental deployment, which is done via an extracted version of the archive being pushed to the server, it worked fine.