Installing patch for Asp.net web application setup - c#

I am using visual studio web project to install my web application and do some customization like modifying connection string in web.config file during install time.
Now, My requirement is to create a patch for the web application so that next time the web installer only the changed files.
Is there is any one to do it using visualk studio 2010 ide or any other way.We can't use third party products like Installshield,wix,innosetup etc.
Please suggest.

Visual Studio doesn't support patches for setup projects. It supports only major upgrades.
If you really don't want to use other setup authoring tools, you can try creating the patch manually. You can read more about this here:
http://msdn.microsoft.com/en-us/library/aa370578(VS.85).aspx
But it won't be easy.

If it is just Web project, I would recommend re-deploy instead of patching. Meaning you just deploy new version of site, above the previous one.
Except some really comprehensive case that strategy works all the time. I use simple xcopy deploy for all my projects.

You can write a mini C# app to do it. You can have the list of assembly files in a configuration. On loading of the app, it checks the timestamp difference between server and client files. On finding the change, the mini app pushes the changes file.
Hope, it will resolve your issue

There may be better suited solutins to deply websites than using an installer. For one, there's Web Deploy.
It's main purpose is deploying web applications to IIS and it allows you to modify key configuration values through a simple UI.
Web Deploy works with deployment packages; a big zip containing your application and some meta data to help install it. On deployment it will diff the deployed site with the data in the deployment package to update existing files, add new ones and remove obsolete files.
You can build deployment packages directly from Visual Studio and/or from MSBuild, using your favorite build server.
Web Deploy works really well when you need to deploy often or when you have to delegate deployment to IT staff.
Customizing Web Deployment package is a bit tedious though, you may find a blog post I wrote about this useful.
For simpler situations, I recommend good version control practices and xcopy deployment.
If you tag what you deploy to your server, you can zip up the changed files since last deployment and copy those to your server.

Related

MVC core MSI builder, how to create installer?

I've written an MVC core app. The next step is to wrap it in an MSI and distribute it to clients. The problem is this: I can't seem to find any built in way capture all the content files and dll's automatically and wrap them in an MSI. I've tried so far windows installer and wix (heat, to be precise) and both of them doesn't seem to have a built in way to work with .net core. Did Microsoft just decided it's not important enough or am I missing something important? I could try to put all the output and all the dependencies, file by file, but that would be hell to maintain, with the new Nuget approach there are many many dll's required for a project, together with all the content it becomes enormous. Any help would be appreciated
I'm still adjusting to this "modern" world and part of me wonders why you'd want to package a .NET core app as an MSI. I'd think you'd be running it in a docker container or windows server app (appx) in the "cloud" or on nano server which doesn't even support MSI. For actual windows servers I'd assume regular old .NET. (Which I still fondly love.)
That said, I have an open source program called IsWiX (CodePlex) and have a very simple pattern for creating ASP.NET website installers (see video at: https://www.youtube.com/watch?v=pgDf1kv8a-4) and I'd be willing to work with you to come up with a similiar story for asp.net-core mvc apps.
From what I read, .net core apps also have msbuild publish profile support. That is what I use to create the model from which I author my installers. From there I just drag drop my files into IsWiX and let it author all the XML for me.
FWIW website installers have always had a lot of files. Even before nuget and npm a website developer might add a few thousand files to their project just by adding say Infragistics. I once worked on an installer with over 300,000 files. Yikes! I always wished we had a way of just creating an uncompresssed archive of this stuff and IIS could see if as a directory but to my knowledge that never happened.
The MSI world is a declarative world where we need to explicitly list each of those files. Web developers live in a world where they just say "publish" and don't care about those details. That is the gap that I try to bridge with IsWiX.

Multiple Publishing web.configs in Visual Studio 2010

In my settings, I have two String settings and one connection string. These obviously show and are changeable in the web.config.
On top of that, not in the settings, but in the web.config, I have my entity framework connection String.
I also have 4 different publishing profiles (Addresses to publish my website to)
However: They all run off the same config file. So I have to change it manually before each publish. And if i forget/get it wrong, the entire site siezes to work.
Is there any way, to link publish specific web.config files. So that each publish profile generates the correct version, with its correct values/connection strings.
Ive come accross transforms, and pubxml, but nothing seems to make sense or work, or even be compatible with VS 2010.
If anyone can link or explain the path i should be taking to achieve this, i would be gratefully happy. I have spent days trying.
You can create a new configuration in the Configuration Manager and then create the corresponding config for that profile.
When deploying, if you change the configuration to the correct one, it will then pick up the appropriate config.
How to: Transform Web.config When Deploying a Web Application Project
I would take a second look at web config transformations - it was built for exactly this and is most definitely supported in VS 2010. Alternatively I have worked with a deployment setup where there was a custom utility that did exactly what web config transforms does by running as a build task. Using the two I would still recommend web config transformations due to it being well documented.
The .pubxml and profile-oriented transforms are available in VS2010 through the Azure SDK Bundle. Here's how to do it:
Have VS2010 installed. I'm using VS2010 Ultimate RTM (had to set up a new machine).
Install the Azure SDK. I'm doing this through the Web Platform Installer; it looks like the last Azure SDK for VS2010 was 2.1. This includes SP1 (if you don't have it already), a further hotfix, and the out-of-band tooling update to support .pubxml, as well as a bunch of other things. If you just want the VS components, I think you can find them at http://azure.microsoft.com/en-us/downloads/archive-net-downloads/ under July 2013 (Version 2.1)
At this point, you can create publish profiles as many of the newer blog posts show:
And add transforms for them:
And preview the transforming effects of each profile's transform (which does take into account the Debug/Release ones as well):

C#, Deploying windows tasks and services after teamcity build

We have a solution which consists of several projects. Some of the projects are windows tasks, some are windows services and some are mvc-websites which are running on a remote server. On this server we are currently implementing TeamCity as CI server for automating our builds and deployments. As of now, the projects are deployed on this same server. The build, test steps etc works fine but I am not sure how to deploy the tasks and services. All tutorials about this subject (at least those I have seen) only concerns deployment of websites.
The most obvious way is to have a post-build step running a powershell script which are uninstalling the current running windows service, removes the old service, copy the new dll and start the service again. The windows task files could simply be replaced directly with the new version.
However, I do not like this solution, it feels very blunt and could perhaps be hard to implement if the deployment server is remote.
Does anyone have any better suggestion on how to make the deployment?
Have a nice day!
Try to look at Octopus depoy: http://octopusdeploy.com/. You can easy integrate it with TeamCity. It has abillity to star/stop service and much more. Moreover it use nuget packages.
You can deploy windows services via Web Deployment Tool as well. All you have to do is to create manifest.xml file with runCommand (un/install and start/stop service) and dirPath (deploy service) providers.
My manifest file which deploys also DB and web site looks like:
<sitemanifest>
<dbDacFx path='$dbSource' />
<runCommand path='$presync' waitInterval='30000'/>
<dirPath path='$winSource' />
<runCommand path='$postsync' waitInterval='30000'/>
<IisApp path='$webSource' managedRuntimeVersion='v4.0'/>
<setAcl path='$webSource' setAclResourceType='Directory'/>
<setAcl path='$webSource' setAclResourceType='Directory' setAclUser='anonymousAuthenticationUser'/>
</sitemanifest>
It's generated by build script in Psake, but you can do it as you wish.
I wrote two blogs about this topic, but they are in czech language.
Everything in one package
Parametrization of package
Hope, there is something that can help you.
Inedo's BuildMaster can pick up right where TeamCity leaves off using the BuildMaster TeamCity Extension. There's a free version avaiable that will probably solve your requirements.
We have to solve this own problem when we use BuildMaster to build/deploy BuildMaster (before installers get built), and if you take a look at the BuildMaster Specifics (Inedo.com > Support > Specifics > BuildMaster, you can see precicely how we stop/deploy/start the Windows service.

Can I create a single EXE in Microsoft Visual # 2010 Express when my applications is depending on Google Data API SDK?

I have an application depending on the Google Data API SDK (which are .dll's).
When I publish the application (Debug > Build Solution), my EXE-file only works on another computer when I copy the references in the same directory which I have included in my Visual Studio project.
The application is querying my Google Calendar for the current event, so I want to be able to run it from a memory stick.
Is there a solution so I can include those DLL's in one single EXE (make it kind of portable?).
Thank you so much!
You could potentially use ilmerge to do this. However, I don't know what the ramifications of this are in terms of licensing, particularly if you're going to distribute the app.
I would personally vote for keeping them separate, and just deploying them next to each other (whether in an installer or on a memory stick).
Most of the libraries Google provides are open-source and hosted on Google Code. This means you can download the source code and include it in the same project as the .exe project. That eliminates the need to have references to other dlls.
Here is the link to the .Net Google Code project. You'll need svn to check out the latest source code. The svn command is here:
svn checkout http://google-gdata.googlecode.com/svn/trunk/ google-gdata-read-only

Need suggestion for how to manage the web application

I have developed a web application also that has been deployed in many client area.
I have created a installer to install this application at client area for first time.
If i done any bug fix or add any new functionality to this site, should i create new installer for site? or How to update the existing site without creating new installer with latest bug fix?
Or, Is there any other option to update existing application?
Or, we can create a installer only install the latest updates?
Please guide me
You can start your journey using the built in web installer (part of Visual Studio).
Important thing is it will only install to a Virtual Directory of an existing web site.
If virtual directories are fine, you then need to worry about bug fixing and updates.
here is a solution...
If you are at the client or have easy access to the web sites via FTP.
You can map drives on your development / test environment to the production FTP sites, then just create a batch to copy stuff over.... best part is - if you're hosting on IIS, if you make any changes to the web.config or any assembly in \Bin you'll trigger an IIS Reset, so this means you shouldn't need to have remote access to their servers.
Make sure that batch updates all web applications in the farm.
You can also fully rely on the application installer - IF YOU'VE FULLY TESTED THAT IT DOES INFACT UPDATE YOUR FILES, LIKE IT SAYS IT SHOULD. Don't just assume it will, test that installer, and retest it... because I have had lots of problems with upgrading a web site, and you can't expect your client to uninstall, reinstall every time.
I wouldn't worry about creating a "patch installer" Web apps are relatively small anyways - and copying unchanged files won't make a huge differance.
Just be sure when you create the installer, you add project outputs to the installer file... and work with project outputs, rather than having to copy stuff in manually to the installer every time you make a change.
Hope this is at least a good starting point.

Categories