I'm confused here, because I've never downloaded WebDeploy (msdeploy) but it's been some time since I use on my vs2010 (and 2012 too) the rightclick on webapp.csproj -> publish (which generates a .pubxml and makes the deploy happen).
Are those the same thing? and if not and I want to separate the deploy as the implementer's work, which is the best to do it?
I was thinking on passing to the msbuild a template with a somewhat embebed pubxml for it to do the magic. But IDK if it's possible or the best path
The publish option allows you to publish the website to and FTP, Web Deploy, FSPE etc. Web deploy is a way of deploying the package. You must install the WebDeploy on the IIS server which allows you to use it.
For more information about WebDeploy: http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx
Related
I am currently running into an issue where I have an mvc project and an API project in the same solution,Visual Studio 2017.
when I build the solution the structure is as follows
solution
solution/area1
solution/area2
solution/api
I am able to reach the api with no issues when just building on my local machine, but when I go to publish the solution the api project builds the dlls but does not build out the solution/api so I cannot navigate to my api calls.
I have tried setting up multiple start up solutions which did not resolve the issue.
When you build on your local machine, you probably use '(Re)Build solution', which builds all projects in the solution.
However, there is no such thing as 'Publish solution'. You can only publish a Project. When you do that, only the project and all its dependencies are built & published.
if your API is in a seperate project and not referenced from the MVC site, it will not be built nor published together with that MVC application.
There are two viable approaches:
You integrate the API in the MVC site (same domain, same routing mechanism, probably seperate area).
In that case I would suggest keeping it in the same project for simplicity.
You develop the API as a seperate application in its own (sub)domain.
Here you put it in its own project. And you build and publish it on its own, seperate from the MVC application.
msbuild MyProject.csproj /p:DeployOnBuild=true;PublishProfile=<profile-name>;Password=<insert-password>
https://stackoverflow.com/a/14232754/2183503 has the answer.
Note: It has some spurious information (regarding passing vs version) though. For example, I tested the command out out just now and it worked fine without the /p:VisualStudioVersion=11.0 in Visual Studio 2019 Developer Command Prompt.
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):
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.
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.
I have recently inherited an ASP.NET website to look after.
I have a copy of all the files but coming from a PHP background I am not sure how to make changes and deploy it.
After I make changes to the site I presume I need to compile it. But can I then simply copy the site onto the server or do I need to create a setup package and 'install' it over the top of the production system?
Also, where does the code-behind DLL 'sit' in the file system?
Is there a decent guide to this kind of stuff?
After making changes and testing them with your local copy (I'm assuming you know how to do that), click the "Copy Web Site" button at the top of the solution explorer. This lets you connect to a remote server (your production box, presumably) and will compare your local version of the web site to the one on the server, and flag any files that have been changed locally. You can then update the server version so that it matches your local version.
If you're deploying the web app as a compiled DLL (instead of as uncompiled CS files), the DLL should sit in the application's \bin folder. Even with a compiled DLL, you still need to deploy the ASPX files.
You don't have to go for a setup. The answers to your questions differ based on whether you are using a 'WebSite' or a 'Web Application Project'. Please answer to following and we can follow up after that;
Which version of .Net / ASP.Net you use? (1.1, 2.0 or newer)
When you open up the package in VS (Visual Studio) and right click on the top most group (solution explorer) do you see options like Build web Site, Publish Web Site?
As a long-shot just try to create an IIS web site pointed to the root of your files and see if anything comes up. If this works the work process will be;
1. Do a change
2. Compile
3. Hit the web site URL and see whether it reflects