I created a ASP.NET Website and pushed the entire code on TFS. But when i create a Build Definition in VSTS i do not see any template for the Website, all the templates are for ASP.NET Web application. The list of templates are shown in the below screenshot:
Screenshot: https://i.stack.imgur.com/j5IOa.png
So if i want to build a website in VSTS do I need to first convert it into the Web Application or is there a third party template available to build my Website in VSTS ?
Edited: The website project structure is show below:
I have given the path till my project file in the Build Solution task as follows:
The build is successful but i get the message that nothing can be added in the Artifact as shown in the below screenshot:
Edited (Latest): When I create a new "Website" in VS 2017 i do not get a project file, only a .sln file is created, so for this website what template and its configuration can i use in VSTS or how can i create a project file(.csproj) so the whole website can come under that project file. The project structure is shown in below screenshot:
Any help will be greatly appreciated. Thanks in advance.
To build website project, you can also use ASP.NET build process template.
The only difference is you should specify **\*.publishproj instead of **\*.sln in VS Build task.
You can also refer the answer in another post.
Related
TFS provides a list of templates that I can use for new build definitions:
Once I've used "Save as template..." on a build definition, I can then use it as a template within that project:
But when I switch to a different project, that custom template is no longer available.
How can I create a build template that I can use in any project?
There is no way to directly copy or sync a vNext build definition template between team projects on the Web Portal. The build definition template is only for the present team project. So you need to create a build definition template for each team project.
And also there have been a feature request in user voice, you can vote up and monitor it
VSO build vnext: share build templates between projects
https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/8468566-vso-build-vnext-share-build-templates-between-pro
However, for a workaround, you can use the REST API to perform this. Here is an example shown in the blog.
It shows how to get the JSON response of a build definition and again using the same reference to make a new one in the project you desire.
You can also take a look at this nice article: How to move build definitions in TFS to other projects using the REST API
As for now it is not supported but you can vote it up to make it happen faster:
https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/8468566-vso-build-vnext-share-build-templates-between-pro
I have a ASP.Net MVC Project in a solution which contains multiple other Class library projects (which are dependencies of MVC project).
Now I want to automate the process of creating multiple DEV AzureWebsites and publish the MVC project (along with its dependencies) through Azure PowerShell Cmdlets.
I know how to create AzureWebsite and other Cmdlets, but I am not sure about how to publish VS MVC Project, take that folder and deploy it in AzureWebsite. Please let me know my options.
PS - I do not want to Visual Studio -> Right Click publish option, because I need to create multiple instances of Dev AzureWebsites.
Good news. The script to do this is already written for you. In Visual Studio, take a look in the PublishScripts folder of your solution. There you will find the scripts and parameter file for your solution. You can use these to publish to other Web Apps (formerly Websites).
The dependencies will be included in the package file that is generated so no additional steps are needed for that.
I'm trying to design a WIX setup project that needs to harvest the output of an ASP.NET MVC Web site.
There are several problems.
Building the ASP.NET project does not output the same content as a web publish would.
So it seems that I need to harvest the output of the published web site, meaning it should be done in a temporary location.
It should work on team build continuous integration (and in Visual Studio).
Every sample I've found so far uses temporary directories and command line steps before building the setup project.
Am I wrong ?
Is there another solution ?
Thanks in advance.
You would need to run those commands as part of your build so that you have that output to then package with WIX.
I have a solution with multiple C# projects linked to a Website (File => New => Web Site).
I can use the continuous integration for all the C# project for now.
I would like to try the website from a different solution just for testing:
I would like to know if the modification of an aspx or aspx.cs file will
rebuild all the solution/project or just push the file which was
modified on Azure.
It seams that the website will be rebuild, or will try to rebuild.
Here is my website test solution
and my Build Definition file :
So my question is, is it possible to integrate a website to a continuous integration system ? (TFS 2012)
If it's possible, What did I miss on the basic configuration ?(I didn't need any specific configuration for a WebApp project or a C# project)
I might need to build some files on the website (App_Code folder), But I would keep the possibility to deploy only the modified files (aspx, aspx.cs) without rebuild all the website and push everything on the server.
Let me know if you need any further information
There is an article here Continuous Deployment di Asp.Net web sites con TFS Build. It is in italian, but I think you may get the core using Bing/Google translator.
I'm using TFS 2012 to automate a build of a solution which contains multiple windows services and two web applicaitons.
I've used the guide I found here to customize the build process template so that the windows services are put in a folder structure that I like. Specifically:
\dropserver\droproot\MyApp\BuildNumber\
\Service1
\Service2
\Service3
\Service4
This works great, but unfortunately it doesn't work for web applicaitons. If I used the same strategy for those, I just get the contents of /bin for each web app, rather than the full site contents.
MSBuild typically uses the web application targets to handle this, but for some reason, this doesn't work when you customize the build as I have. I no longer get the _PublishedWebSites folder in the build output. (I'm guessing that's because I cleared our the OutDir property of the MSBuild task.)
Has anybody done something like this and gotten it to work with web applications as well?
I think I can help with this, it looks like in the build targets that the published websites folder isn't created if the OutDir is the same as the OutputPath.
So this isn't perfect, but if you add the following into the csproj file in the first property group, you'll get everything deployed into "\bin\deploy\" including the _PublishedWebsites folder
<DeployOnBuild>True</DeployOnBuild>
<OutDir>bin\deploy\</OutDir>
With a bit of customization, this solution ended up working for me:
http://www.edsquared.com/2011/01/31/Customizable+Output+Directories+For+TFS+2010+Build.aspx
Basically, did what that link recommended, but also leveraged a new solution configuration (which I called TeamBuild) rather than conditional property definitions.
I believe the key to making this all work was the passing of the outputDirectory as the TeamBuildOutDir argument to MSBuild. Embedding this variable reference in the OutDir or OutputPath variable was allowed Team Build to build to the correct staging location and then automatically copy files from that location to the drop folder.
I'm going to take this a little futher and get rid of the whole _PublishedWebSites thing, but that will be done entirely in the build workflow.
EDIT: TFS 2013 supports this natively with a simply build configuration option:
Take a look at this thread as this post as well.
Team Build: Publish locally using MSDeploy
Since you need all the files for your web projects, you need to trigger the publishing process, and by tweaking the destination of that process, you can have all of your files copied where you need them.
I think option (2) from his answer will work for you.
I hope that helps.
As I can see in your reference link, it will just compile and package the binaries. It does not deploy the website by the steps mentioned in that.
If you want to get the .html, .css, .js etc. under the _PublishedWebSites folder, you need to do a Web Deployment. This manually we can do by clicking the publish option from right click menu of your VS project and by selecting Publish Method as File System.
But, since you need to automate this in your build and drop it in custom drop folder, you may need to manipulate your MSBuild script by calling a AspNetCompiler task. You can get more information on this at the MSDN link. By specifying the TargetPath while you call this target you can get your Web files deployed at the appropriate custom drop folder.
Happy Scripting.
Have you check this blog, this solved my problem where I wanted customized TeamBuild Ouput Directory.
Customizable O/P with TFS 2013
Customizaable O/P with TFS 2012 and .NET Framework 4.5