WebSetup Installer for configuring IIS settings - visual-studio

I have created a websetup using Visual Studio for deployment of a web application.
How can i get it to setup additional IIS settings ?
Like setting up wildcard, virtual directory, permissions, etc.
Basically stuff you can control using the inetmgr.
I would like to automate the configuration as much as possible.
Users always make mistake!
Thanks!

See my answer to this question. You can create a custom build task that can automate many of the IIS configuration steps you mentioned.

Decided to go with WIX 3.5 installer.

Related

How to deploy Azure WebJob using different configurations for different environments in Visual Studio

We have several Web Apps and WebJobs with different configurations for different environment, e.g. Test and Release.
Each WebJob is deployed to a Web App using "Publish as Azure WebJob" in Visual Studio.
We are using the Config Transform extension to transform the App.config that consist of different config sections, connection strings and app settings that needs to be transformed. This works fine for local Debug and for Release.
The problem is that when we use "Publish as Azure WebJob" there is no way to specify which configuration to use and Release is always built and published even if Test is selected inside Visual Studio.
We have also tried to deploy the WebJob together with the Web App but it almost always hangs, same as described in Stuck when publishing Web App to Azure with WebJob
We don't need to use config transform if that's not possible, e.g. we could configure directly in Azure. But I haven't found a way to configure config sections directly in Azure.
Yes this is a known VS tooling pain point that comes up often. The short answer is that web.config style transforms aren't supported for general application types like Console apps.
This has been discussed recently in the context of WebJobs in our public repo here. That issue also links to the VS User Voice issue for this. That item also links to the SlowCheetah VS extension which some users have said works for them. You might give that a try.
If that doesn't work for you, then you'll have to manually manage your settings via the app settings blade in the Azure portal.
I added a prebuild step to change the webjob-publishing-setting.json file and the app.config file depending on which Configuration is selected.
The webjob-publishing-settings.json only had the name. Then from Visual Studio 2019 I used "Publish as Azure WebJob" and that created a second webjob with the new name and new configuration.
Works great!

Publish website without roslyn

I am trying to create web application using Visual Studio 2015 and .NET 4.5.1.
When I publish the website, visual studio create folder named roslyn.
I know it's used to compile code on the fly, but unfortunately my hosting provider doesn't allow me to execute the compiler on their server.
How to publish the website without roslyn like previous version of Visual Studio?
EDIT:
I got this error when trying to acces my website.
It seems IIS trying to execute roslyn\csc.exe but my user account doesn't have permission to do that. With previous version of Visual Studio, this error doesn't show up.
I've just faced the same problem. When you create a new web project, two nuget packages automatically added to your project. If you remove them, your problem should be solved. Package names are: "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" and "Microsoft.Net.Compilers".
I had the same issue. Followed the steps from here. Basically:
Uninstall the package
Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform <Your Web API project name>
In your publish profile settings, uncheck "Allow precompiled site to be updatable". You can find this under Settings > Precompile during publishing > configure
After searching the same issued I face, I just came here. I read the above answer which is right.
I give the answer, because of Here is the good article to explain :
Why the publish code have this exe as well as development environment ?
What is the benefit and how to remove?
This is also the very good article, about the history of this exe
After countless effort....and according to this website.
I find that you can use /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false in MSBuild to transform web.config, this also include the roslyn compiler in the build. The output is same as what you get by publishing in Visual Studio into file system
There is an open bug on the roslyn repository about this issue.
In my case all I had to do was to downgrade the dll Microsoft.CodeDom.Providers.DotNetCompilerPlatform from version 1.0.6 to 1.0.5.
I have had the same issue in Sept2016 when I took over an existing ASP.NET program. I found that there were multiple versions of the two compiler packages mentioned by Kemal installed in different projects of the solution.
So firstly I updated to get them the same. VS doesn't tell you that updates are available in this scenario (or maybe I missed them ?)
I then had to restart VS2015 for the packages to clean up properly.

How to make Project installation setup like VS 2012?

Today i installed vs 2012, I have seen the installations setup is very nice. Is any possibility to make Project installation setup like VS 2012?
Actually, I think that setup is built with WiX, as a bundle that wraps several separate MSI files, and with custom bootstrapper UI. I think there's a vdProj to WiX converter that creates a WiX install file, but I've not used it.
You can use the Laika42 Themed Boostrapper:
http://visualstudiogallery.msdn.microsoft.com/6e84def3-9f27-4292-aa3b-3ec542338e4a
Update:
Just found out that this product has got a new name Visual Installer. Product site is here.
Screenshot:
do you wish to create these kind of windows or are you searching for an app, which wrapps your setup (like installshield....).
if the first one: http://msdn.microsoft.com/de-de/library/windows/apps/hh986965.aspx

How to create the asp.net web setup project

I have a Asp.net application which I want to make it easy to depoly in client machine by click the .ext or .msi file.
Then I found the "web setup project" in vs.
However I have no idea how to make it.
In my case,my application need .Net 4.
And after the app is deployed I have to modify something in the web.config which I want to gather through the install wizard.
Also I need to do some clean work after deploy(modify some files).
So I wonder if my requirement is possible using "web setup project",and how to make it?
In Visual Studio you can modify files during install only through custom actions. So you will need to write custom code which does what you need. Regarding .NET Framework 4, it can be added as a prerequisite.
If you want an easier solution, you can try a commercial setup authoring tool: http://en.wikipedia.org/wiki/List_of_installation_software
For example, Advanced Installer has a dedicated project type for ASP.NET applications.
Yes,We can make Custom Actions(Framing Connection during installation ,Consuming WCF service for Web App)to .msi file during installation.
If you want to have more clear picture about this refer my articles.
This is to create or change Connection string along with setup creation for Windows Application
http://www.codeproject.com/Tips/446121/Adding-connection-String-During-Installation
In this creating setup file for Web App which consumes WCF service
http://www.codeproject.com/Tips/477202/SetUp-file-Creation-for-Web-Application-which-Cons

Configuration File Transformation with Azure Worker Roles

I've just been upgrading an Azure project to Visual Studio 2010 and have been taking advantage of the new XML configuration transformation feature that is built into VS2010 web projects. It seems to work great with Azure web roles. I even managed to get the Azure project service configuration file to do a similar thing by following the instructions here.
However, I can't seem to get configuration transformation working for the lone worker role in my Azure project. I know that VS2010 only has built-in support for config transformation with web roles, but I found a good article describing how to get config transformations working with non-web projects. I've followed the instructions and it works - but only to a point. It successfully spits out the correct .config file (with appropriate transformations) into the worker role project's own bin directory, but it doesn't pick this new .config file up when it's put into the cloud package.
I suspect there's some MSBuild trickery needed to get this to work, but I don't know MSBuild very well, so am appealing to any gurus out there for help and/or samples :)
I have found the best way to do this is to use msbuild. I usually do this with a separate msbuild file outside my solution so I keep the local dev settings separate from the production settings. You can find out more here. I then can run the build to change the settings and upload the project to Azure. I can also run this to change the settings and then run deploy through VS if I need to debug the problem. I also have a target in the msbuild file that then can revert everything back to local. It would be nice to have these things in VS (which I have asked for from the product team). The sample project is on github.
This is also explained in the book we wrote in the Life Cycle chapter.

Resources