Web config transforms not working with Visual Studio online, VS2013 and Azure - asp.net

I have an MVC5 website successfully deploying a staging and production release to Azure using continuous integration from Visual Studio Online (TFS).
I have followed this blog post
Continuous Delivery to Azure Websites with git using custom deployment script
I have even added the build that is required to build to my publish profiles. ie.
stagingbuild | any cpu.
note: this was not mentioned in the above mentioned blog post.
The sites deploy ok using by VS2013 build but the configs are not transformed. I just get the default web.config settings and not the transformed ones from web.staging.config etc.
note: I am only trying to transform one appSetting at the moment to get it working
I totally understand how to write transforms so I don't think this is an issue and when I preview my transforms in VS2013 they transform in the previewer window.
note: I am not publishing directly from VS but committing my changes to repo and continuous integration kicks in from my Visual Studio Online repo.

Try:
Open Builds in Team Explorer
Edit Build Definition of your build
Set Process > Build > Configurations > Any CPU|Release or any other configuration/CPU combo.

Related

Converting - asp.net mvc 5 web application (Visual studio 2017) to .exe setup file

I would like to know if there is any possibility to convert an asp.net mvc 5 web application into an .exe setup file. I tried various links. But i didn't get any output. I received a .msi file and when i tried installing, the installation stops right at the beginning displaying a message = "installation stopped. Please try again". or if i try to install the setup file i get a message = "Invalid.. Please check if package exists...bla bla bla"
Some of the links that i tried are listed below.
https://www.c-sharpcorner.com/article/step-by-step-guide-to-create-a-setup-for-a-web-application/
https://weblogs.asp.net/scottgu/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005
https://www.c-sharpcorner.com/article/creating-setup-and-deployment-projects-in-vs-net/
https://www.codeproject.com/Questions/297343/How-to-create-exe-or-msi-file-setup-file-of-web-ap
And Much More...
You first need to do some preparation:
Set up IIS 6 Management Compatibility (To prevent those "Installation stopped" errors)
Install Microsoft Visual Studio Installer Projects extension. (To add setup project template to VS)
Then you can create and configure and setup project and run the setup.
Details
1 - Set up IIS 6 Management Compatibility
Open Turn Windows features on or off → Internet Information Service → Web Management Tool and check at least the following items:
IIS 6 WMI Compatibility
IIS 6 Metabase and IIS 6 configuration compatibility.
This is to fix the following error:
The installer was interrupted before application could be installed.
You need to restart the installer to try again
2 - Install Microsoft Visual Studio Installer Projects.
This is to add setup project templates to Visual Studio. Here, we are interested in Web Setup Project.
3 - Create and configure the setup project
Create setup project
Right click setup project → Add → Project output and choose what you need. You need at least primary output and Content Files from your web project.
Then you can build the project and run setup.exe.
Note
You can setup other properties like ASPNETVersion, Manufacturere, product Name, ...
If after deployment you faced with error complaining about \roslyn\csc.exe, you may want to include roslyn files or remove roslyn compilation at all. For more information take a look at this post.
You can add CustomAction to do some custom actions during install/uninstall. You can find a lot of examples around, like this post.
You can even customize UI and add some input and use them during installation. You can find a lot of examples around, like this post.
In general, if your deployment is a common site deployment having a few files and database, a better option is creating Web Deploy Packages and then install the package to IIS. You can automate that process easily.
vs-2017 ---> other project types ---> web setup project
Screen shot

Unable to configure Application Insights Status Monitor on Live IIS Web App

Application Insight is working perfectly fine on local dev but giving issue on server with the Status Monitor. Following is the error:
The application is using an older version of Application Insights for
the Visual Studio Online. Remove ApplicationInsights.config and
Application Insights Nuget package references from your project and
Application Insights to your project using Visual Studio 2013 Update 3
or later.
I followed above instruction same result. Mainly I followed this article but I have also tried the following:
Make a copy of ApplicationInsights.config if you customized ApplicationInsights.config.
In Solution Explorer, right-click your project and choose Manage NuGet packages.
Select Browse.
Search for Microsoft.ApplicationInsights.Web, select it and choose Install/Update. You need version 2.2.0 (or later).
Reinstate any customizations you made to ApplicationInsights.config. Most of the changes you'll see when you compare the files are because we removed some modules and made others parameterizable.
Rebuild your solution.
It didn't work.

Configuring existing ASP.NET project for DNVM, DNX environment on a Mac

I have an ASP.NET Web API project created on Windows using Visual Studio. How can I set this up for use with DNX/DNVM (on a Mac)?
Switching to Git solved the source control compatibility with TFS. But I wasn't able to find references to getting a project working across both these development environments.
I'm assuming as a first step the project will have to be migrated to ASP.NET 5/vNext but wondering other problems lurk around the corner with different project members using different environments.
I get an error when I run - git:(master):dnx . kestrel
As you mentioned yes you will have to migrate any namespace changes. I have a project that is developed across both. Also changing csproj files to xproj. Support is coming for some kind of interop between the different project types but its not here yet.
For build, publish, deploy from git without relying on VS publish capabilities or MSBuild you can follow my blog post here.
Basically you use DNU to publish and then kudu to deploy.

Web Deployment tools for Visual Studio 2013

I am responsible for supporting a relatively complex Website project written with .NET 3.5.
Previously I was using Web Deployment Project with Visual Studio 2010 to deploy this website but at the moment I have only access to Visual Studio 2013.
As far as I know, there is no longer such a tool to be used for deployment in Visual Studio 2013 and I do want to compile the code before deploying to the production server. As mentioned earlier, the project is a bit complex and this would not be easy to be converted to a Web Application.
Any idea?
Unless I missed it, unsure what the issue is - in VS2013, Publish is what you are looking for (either WebSite or Application).
What exactly do you mean by "none of the (vs 2013 publish) options worked"? What is/was the issue?
In one of your comments, you state you want to "pre-compile" (aka "don't want to upload .cs source files) and that's a setting in Publish.
You can Publish to your local file system: "Custom" -> File System:
This extension still exists for Visual Studio 2013: http://www.iis.net/downloads/microsoft/web-deploy
Little bit confused with the question because you are keep referring about website rather web application.
If you are looking to convert web site to web app then you need to follow this: http://msdn.microsoft.com/en-us/library/vstudio/aa983476(v=vs.100).aspx
Otherwise, if you are referring about the deployment project. Yes, it is no longer available.
I'd a very similar situation like you and Since 2013 I have stopped using any deployment project, instead I have started using Publish that creates a deployment package for you on a Network , FTP, Local Drive or even on Azure.
Here is a nice guide from Microsoft
http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx
If you still want to go for Deployment Project, then you would need to go for "Installshield" limited edition,which is free (http://samirvaidya.blogspot.com.au/2013/11/how-to-enable-installshield-le-for.html).
http://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.110).aspx

Can I use Web Config Transform when publishing to azure with Visual Studio 2012?

I have three enviroments for my asp .Net mvc application Local, Development and production. This means i need three webconfig files. The transformation seems to work fine with local and development deployment through a build server but not when deploying to production. It works when i manually publish the site from visual studio 2012.
Does it have something to do with the servicConfigurations for the different enviroments?
If you're going to Azure, then you can use publishing profiles. The trick is to chain your config files with your environment settings in Visual Studio.
There's an overview of publishing profiles here:
http://msdn.microsoft.com/en-us/library/ff398069.aspx
And Scott Hanselman walks through a number of scenarios with chained config files here:
http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
With those two pieces, there is enough info there to not only manually get the configs transforming, but also to work those into CI.
Hope this helps, cheers.

Resources