TFS Build - Generate Website (no webproject) - c#

I have many projects that I want to build using TFS Build. I have no problems with Windows Forms and WebForms PROJECTS.
But when I try to use TFS Build to build ASP.NET Website (the classic one), I have these problems:
I don't have any options to compile the project with Test Configuration (only Debug or Release).
I can't build an ASP.NET website because it's not a Web Project.
I want to know if there's a way to publish the website's precompiled files to the same shared location where I have my other projects.

I think I might need a bit more detail here, or maybe I'm just clueless :-)
Test configuration - I'm assuming you've set up a Test build configuration? If so, I'm not sure off the top of my head what's going on, but I've seen people forget to create the build configuration.
We've had no problem with our Websites, they get moved to build output or to wherever you specify in the Website properties pages
If you mean you want to use WebDeploy to publish, you're out of luck for the website - only web projects will do that. But do a little team build customization, and you should be able to emulate that.
Not super satisfied with my answer, but hopefully I've pointed you towards something helpful...

Related

TFS Build Issues With Multiple Versions of the Same Assembly in Different Projects

I keep running into an issue with our TFS build server. I've got 2 projects (both in the same solution), 1 is a WebForms project, running .Net 4.0. The second is an ASP .Net MVC5 project running .Net 4.5. There is also a Silverlight project, but the problem is reproducible with just the first two.
Both of these projects use NuGet packages for various libraries. Sometimes there are different assemblies within a package for their respective environments. A .Net 4.0, 4.5, SL assembly, etc.
The build server seems to dump all of the libraries required into a single folder, then pulls from that to build the solution. This causes problems in many cases, with the wrong project getting the wrong assembly version. This does not occur locally, only on the build server. I can't figure out what I need to do to keep this from happening. Any ideas?
Yes, I hate this standard behavior, but TFS will output everything to the same folder by default, and then you will get various errors depending on which order msbuild compiles your projects if you have references with the same name or even project outputs with the same name.
The easiest workaround is to use the AsConfigured option on the Process tab, '2. Build' -> 'Output location' of the build definition window. This keeps your normal source structure intact, but I think you will lose support for automatically dropped outputs (i.e. you will have to provide a script to do that yourself). If you are only using TFS Build for validation, this is the cleanest approach.
You can also use the PerProject setting and split up your projects into two distinct solutions, perhaps suffixed by platform (we've done that numerous times in our company). Then, you specify both solutions to the build process and it will create two separate folders in the output, one for each solution.
This is all assuming you are using TFS 2013. In TFS2012, there is a similar option but it is in '3. Advanced' -> 'Solution Specific Build Outputs'. You will probably have to go this route if you are using TFS2012 or you will need to modify the default workflow yourself to add your own logic.
EDIT:
From your comment to the other poster I see you are using TFS 2010. Well... I think this was absolutely not supported at that time, I remember having similar problems, but we upgraded to TFS 2012 and all was well.
I think your only option is to either create two separate build definitions and build each solution that way, or you will need to checkout the xaml workflow and edit it with your own logic. Perhaps downloading the TFS2012 template and "porting" it to TFS2010 would be a better approach since at least you would not be reinventing the wheel that way.

TFS Unit Testing Build Questions

I have a solution that has 4 projects in it. 3 are dependencies for my tests and the other is just my tests.
DL
BI
MySite (web site)
MyTests
Some unit tests in the MyTests project reference namespaces in the web site MySite for some MVC contollers.
Question is how do I get just the MyTests project to build and deploy with a TFS build. NO matter what I try the _publishedWebSites folder on the TFS build machine always has the web site and not the MyTests folder. For some reason it thinks it is building the web site and not the tests. Any help would be appreciated from the build definition or solution perspective.
The purpose is to build the tests and distribute them to a server where they can be run (selectively) using the command line tool in the task manager. I cannot distribute them if I cannot get the solution to build properly.
Alright so there are a few things. Firstly, you need to make sure that the outer solution recognizes MyTests as the start up project and has the other projects as build dependencies. However, this likely won't solve your problems. In order to do this you'll probably have to create a custom build script or edit your solution/project files by hand. The problem with the latter approach is that if other people are building MySite from this solution editing the project file to exclude it's output from the drop is going to cause problems for them.
My personal approach would be to make an MSBuild script which specifies the order in which to build the projects and which files you want in the drop. It's fairly straight forward and it will probably be easy to specify the output you want (this is sometimes very tedious if the projects build is messy to begin with or it has excessive and convoluted dependencies).
Here's the outer most resource for MSBuild. I'd look it over and think about what the simplest solution is but I wouldn't be surprised if you can just make every project build using their project files then add a single build step to cleanse your output.

Local deploy in vs2012 using web.config transforms

Our shop is testing out Visual Studio 2012 so that we're ready to use it once it drops, and I've been tasked with running it through the paces to make sure everything will work as needed. So far I have only found one issue, and that is deploying our solution with our web.config transforms so that I can then transfer it to the servers for use in on our development network. We've set up different configs (release, staging, development) as needed and they all work in VS2010, but when I try to find the place to deploy the package as I normally do I can't find anywhere to do it in the IDE.
I've found a ton of articles online about publishing to a server or using FTP but in our environment that isn't possible, we have to build it on our machine and then transfer it sneakernet style (not ideal but required) to the servers ourselves. I can't seem to find how to do this though. Does anyone know how to do this?
This may not be what you are looking for, but can't you right click on the root folder in solution explorer and select publish website? (I would have made this simply as a comment, but I don't have enough rep to do that.)

VS 2010 Debugging old build

I have a visual studio 2010 web project that when I publish it in debug mode the application works fine and is the latest build.
However, when I try to click the play button/debug mode (in the same build configuration as what I published in) the assembly version is older than the most current one. As mentioned, this is a asp.net application using a c# class library as a reference (also in the solution) and I am debugging using Visual Studio's built-in web server.
I've tried everything I could think of at first in all different combinations as follows:
Clean solution
Clean each individual project
Build solution
Build each individual project
Rebuild solution
Rebuild each individual project
I tried to use a different browser and cleaned my cache as well.
Has this happened to anyone? How can I correct this issue?
It is most likely not set to build. To test this, try build then debug and see if things work. If so, then it is definitely not set to build.
To solve this, open up the Solution Properties. Go to Configuration Properties >> Configuration. Then run down to the project in question and check the Build checkbox. You will then be able to debug again.
This one bit me when a coworker decided the build of the UI was taking too long for his testing and removed it from the build. After discovering the issue, I had him create a separate solution to test in isolation. Yes, multiple solutions can contain the same project(s).
did you try deleting your bin and obj folders and removing your assemblies from the GAC? I would guess that THIS is the problem.
Don't forget to clean your Temporary ASP.Net (c:\WINDOWS\Microsoft.NET\Framework[version]\Temporary ASP.NET Files) files.
After that, do a rebuild and try.
Also, for local development, if you can, then do not GAC assemblies. GAC them while deploying to integration environment. THis will help speed up development a bit.

pre compile website in Setup & Deployment

Every time I use Setup & Deployment to create a new Web Setup, and run it (after edit all the nice things in the properties), the output is always a copy of the Web Site project...
How can I output a PreCompile version of the WebSite project?
What I did was, publish the Web Site (so I get the precompiled version), add this new precompiled web site as an existing Web site to my solution and add it to the content output of the Setup...
well, the idea was good but I get an error saying:
"This application is already precompiled."
alt text http://www.balexandre.com/temp/stackoverflow_precompiledquestion.png
:-(
Bottom line is that I just want a Setup file that gives me the precompiled version of my Web project, how can I accomplish this?
I see you tried the standard Web Setup project from VS.
Scott Gu's blog post takes you to this page:
Visual Studio 2008 Web Deployment Projects
which is a plugin for Visual Studio that activates an additional "right click" option to any Web Site project to add such a deployment project. You can see here what I created.... And the output is a pre-compiled web application. Now, if you add a regular Web Setup project to your solution, and point it to the previously created Web Deploy project as its content, ... I got a valid build, no errors and an MSI file was created...with dlls inside it.
http://img222.imageshack.us/img222/6177/71881923mj9.jpg
I hope this helps you.
I was searching for this solution from google for long days. What i did is i precompiled my website to one folder and added that folder as a new website to my
solution(While adding it will give a warning message that it was already precompiled content. No probs). Now add this project output to the my setup project and one more important thing is in my web deployment project i just disabled Building of my precompiled
website.
I just got my thinks working. If you want you can try that.
Regards,
Rousseau.A
you may be having "PrecompiledApp.config" file in the root of your web application (please check in solution explorer).
I faced this issue and removed "PrecompiledApp.config" from solution explorer and solved the issue.

Categories

Resources