I have an asp mvc project. I'm wondering, what's the difference between building the solution and then copying bin and all other views/scripts/images/style sheets and publishing (besides the obvious work of copying files). I'm asking because i want to automate my deployment with rake and I can't use web deployment because it's not compatible with mono.
Depending on your version of Visual Studio and settings, Publishing typically does two main things in addition to the build
Packages the solution
-- usually into some standard format (WebDeploy, Web Project)
Automates deployment
-- typically hooks something like MSdeploy ("web deploy") to synchronize the site with a local or remote IIS setting
So in terms of what you are deploying, there is no difference. The build and output files are the same. Publishing is simply allowing a developer a simple path of packaging + deploy, which you are handling with rake.
BTW Have you looked Uppercut this tool could be very useful in your build process.
Related
Is this possible?
We currently have build definitions and release definitions setup and working for Web Applications. However we have a lot of older web site type projects and will not work with the current build and release definitions that we already have setup.
Is there a way for us to get the web site projects to work with the build and release definitions in TFS?
Thanks
Recently changed my steps for the build definition and now that build is successful but the release still fails.
Build definition Steps are:
Nuget Installer, Copy Files, and Copy and Publish Build Artifacts
Release definition Steps are:
Powershell on Target Machines, and Windows Machine Files Copy
As web site projects needs bin folder and TFS doesn't want them to be stored in source, the best way to achieve is to convert web site projects to web application.
Best practice: Converting to web application:
https://msdn.microsoft.com/en-us/library/aa983476.aspx
But they made a workaround maybe you can try:
https://blogs.msdn.microsoft.com/tfssetup/2016/09/21/building-a-website-with-tfs-build/
While learning continuous integration, i come across both of these terms. And i got confused. May be it is a very silly question. But i want to know in continuous integration process what are the role of MsBuild.exe and MsDeploy.exe. Can i use one over other. Or do they have there own purpose.
I have also tried to use both options but while using them i got following error on server request timeout for "www.serverurl/MsDeployAgentService"
Should i use www.serverurl.com/msbuild.axd or www.serverurl.com/MsDeployAgentService.
As far as i understand, they both build and publish application with config transform.
Please help me out.
You can't build using msdeploy, but you can build and deploy using msbuild or you can build with msbuild and deploy with msdeploy
MSBuild is a hierarchical target-based build system. It's intent it to run general purpose tasks related to building an application, and is primarily focused around compilation. Visual Studio uses this when you build your project.
MSDeploy (or Microsoft Web Deploy) is a CLI and library for deploying files (and other configuration) between servers. It handles concepts like authentication, skipping files and environment-specific parameters. Visual Studio uses this when you select "Publish".
We use Nant and devenv.com to build all our assemblies including the website project. Then we would use aspnet_compiler.exe to compile the published website.
Is this the correct way to do it? Historically, we always used the aspnet_compiler with plain vanilla website folders, but I'm not sure if this is really the correct tool for publishing websites that are part of a website project. It sort of feels wrong to have to do this as a 2 stage process using 2 different tools.
Using aspnet_compiler.exe is one of many ways to publish a website:
http://forums.asp.net/t/1544792.aspx#_What_is_the1
Since a web project can be compiled using msbuild (instead of devenv.com), you can also create a custom msbuild target to publish your files:
http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild
In this way, you can combine the compiling and publishing of the web site in one step.
If I understand correctly with our deployments most code gets compiled on the workstation, and the aspx/ascx files get compiled on first access on the server. Is there anyway to precompile these?
I would like to do this to trigger compile errors at workstation compile time, rather than at "run-time" and also to potentially allow C# 4 features to work in views as we use .NET 3.5 on the servers.
Visual Studio provides the command-line tools aspnet_compiler and aspnet_merge, and I blogged about how to call them from a batch file.
You can also add aspnet_compiler as a Post-Build event in the project to find compilation errors, but it slows down build times.
If you develop for .Net 4, you need to have the .Net 4 framework installed on the web server.
Follow this link for precompilation overview: ASP.NET Precompilation Overview
Also, if on server 4th framework doesn't installed you can't use C#4 features in your project even if you will precompile application on your dev machine.
I want to set my server to automatically build my application upon commit on SVN repo, then deploy on a test/homologation server.
What I planning to do:
install a build tool (Nant? use MSBuild?);
create a simple script and set a hook to SVN that starts the process of building and deploy.
To do that, what I need to install on my server desides the .NET 3.5 framework? Is Nant capable of build our application based only on our solution file (.sln)?
I researched a little bit, and the Nant last release, v0.86 beta 1, does not include the solution target.
Is there other alternative to do that?
Note that currently I only use the VS2008 build system, and do not call the MSBuild directly. Is that feasible and simple to setup on server environment?
Just use CruiseControl.NET or TeamCity.
They're both fully-fledged continuous integration servers with lots of features and easy to configure.
We use Hudson to do that. Like mentioned before. It supports MsBuild (and Nant). We use msbuild with as paramters the solution file and the build configuration like debug/release (we created a deploy and watin configuration with different web.config's). No extra tasks or different scripts than the solution file we us in visual studio. (which I think is the setup you're after)
Additionally before deployment we setup a webserver (cassini) with the results of the build execute nunit (watin) tests. All through Hudson, which shows a nice diagram of the nunit test results.
TeamCity and CruiseControl.Net should be capable of doing the same thing,but I found hudson to be a snap to setup, and configure. (It has everything included in a package just start it)
What's also nice is that it supports SourceCop and FxCop results which you can view in a diagram and look at the location a certain warning applies to in the sourcefile, all using the web interface.
You could use Hudson or Cruise Control for it.
They are Continuous Integration Servers, and can also run your unit tests before deploying it.
I think you are looking at installing Cruise Control.Net. It will handle automatically checking your SCM repository, and kicking off anything build related you want.
http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET
As for NAnt or MSBuild - it's a personal choice. I went with MSBuild as NAnt hasn't been updated in a while. That being said - they are both capable of doing whatever it is you are looking to do.
One note - if you compile in Visual Studio - you are using MSBuild. You can target the SLN or PROJ files with MSBuild through Cruise Control.net.
I use Teamcity and it was very easy to set up. Before that I used plain Nant. The Teamcity server realy changed things, because now everybody in the team understands what is going on on the buildserver.
It is free for up to 20 project configurations.
For Asp.Net you will also need Web Deployment Project on any type of buildserver you choose.
Are you realy shure you need to build sln? For a typical ASP.NET project this is not the best way. You usually build a WebDeploymentProject. Anyway Teamcity (and other buildservers I guess too) understands sln-files.