Publish ASP.NET Website does not work with MS Build but works with Visual Studio 2013 - asp.net

I am having a bit of trouble with attempting to File Deploy a series of ASP.NET Websites from a single solution using MSBuild. I have created publish profiles for each website and have named the profiles the same as I can only provide a single profile name to MS build.
If I choose Publish on a single site using Visual Studio 2013 I get the build output I expect and in the location I expect. However, if I use MSBuild on the solution file using the following command (which may be incorrect) I do not get any files published to the locations I expect.
msbuild MySolution.sln /p:DeployOnBuild=true;PublishProfile=Debug
note: I am using the Developer Command Prompt for VS2013 to get access to MSBuild.
any direction is greatly appreciated.
Thank you.

Related

using visual studio team services to build a solution containing multiple web apps and deploy these web apps to azure

My team uses Visual Studio Team Services to manage our source code in a TFS repository. The solution contains multiple web apps. I am trying to configure Continuous Integration and Continuous Deployment for this solution such that each web application is deployed to the correct Azure web app after a successful build. I've configured the BuildDefinition to build $/MyProduct/MAIN/MySolution.sln. I've defined the following parameters to MSBuild based on some MSDN articles I found on this subject:
/p:DeployOnBuild=true
/p:WebPublishMethod=Package
/p:PackageAsSingleFile=true
/p:SkipInvalidConfigurations=true
/p:PackageLocation="$(build.stagingDirectory)"
The build steps include a Visual Studio Build step, a Visual Studio Test step (currently disabled to minimize complexity), an Index Sources and Publish Symbols step (which I don't think I really need), and finally, a Copy and Publish Build Artifacts step.
I am able to build this solution using this configuration. I can see the build results, the build log, build details, etc. When I look at the artifacts that are created, I see two artifacts: "drop" and "build.sourceLabel" If I explore the drop file using the Artifacts Explorer, I find all of my projects in this drop file, and for the web app projects, I can navigate into the webapp1\obj\QA\Package\PackageTemp\bin folder and see all the DLL's etc. for the web app.
What I don't see is one zip file per web app, which is what the Release feature of Visual Studio Team Services is expecting.
I would like to know how to modify my current configuration so that I can generate the correct artifacts from the Build step so that I can create the correct Release Wep App Deployment tasks to deploy each web app to the correct web app in my environment.
This is all being done with Visual Studio 2015 and Visual Studio Online (Team Services).
To test your situation I used Visual Studio 2015 and created 3 new web projects in the same solution and checked into VSTS. I then created a new build using the Azure Website deployment template. Many people miss that we have Build and Deployment templates on the Create New Build Definition dialog. The reason I use the Azure Website template is because I can never remember the msbuild arguments to pass in. You can simply delete the Azure Web App Deployment task if you are going to use RM.
One change I always make to the msbuild arguments is the PackageLocation. I always change mine to $(BuildConfiguration). That way I can build both Debug and Release at the same time should I desire.
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(BuildConfiguration)"
Finally I change my Copy and Publish Build Artifacts task to search for just “**\*.zip”. Leave the Copy Root empty and run your build.
When your build completes you will have one zip per project under the [ProjectName]/[Configuration]/projectName.zip when you explore your artifacts.
If you have further questions you can ping me on Twitter #DonovanBrown

Web Deployment tools for Visual Studio 2013

I am responsible for supporting a relatively complex Website project written with .NET 3.5.
Previously I was using Web Deployment Project with Visual Studio 2010 to deploy this website but at the moment I have only access to Visual Studio 2013.
As far as I know, there is no longer such a tool to be used for deployment in Visual Studio 2013 and I do want to compile the code before deploying to the production server. As mentioned earlier, the project is a bit complex and this would not be easy to be converted to a Web Application.
Any idea?
Unless I missed it, unsure what the issue is - in VS2013, Publish is what you are looking for (either WebSite or Application).
What exactly do you mean by "none of the (vs 2013 publish) options worked"? What is/was the issue?
In one of your comments, you state you want to "pre-compile" (aka "don't want to upload .cs source files) and that's a setting in Publish.
You can Publish to your local file system: "Custom" -> File System:
This extension still exists for Visual Studio 2013: http://www.iis.net/downloads/microsoft/web-deploy
Little bit confused with the question because you are keep referring about website rather web application.
If you are looking to convert web site to web app then you need to follow this: http://msdn.microsoft.com/en-us/library/vstudio/aa983476(v=vs.100).aspx
Otherwise, if you are referring about the deployment project. Yes, it is no longer available.
I'd a very similar situation like you and Since 2013 I have stopped using any deployment project, instead I have started using Publish that creates a deployment package for you on a Network , FTP, Local Drive or even on Azure.
Here is a nice guide from Microsoft
http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx
If you still want to go for Deployment Project, then you would need to go for "Installshield" limited edition,which is free (http://samirvaidya.blogspot.com.au/2013/11/how-to-enable-installshield-le-for.html).
http://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.110).aspx

Build and publish web site project with VS 2012 and TFS 2010

I am using VS 2012 and TFS 2010. I am trying to build a website project (NOT a web application project) and deploy it to a test web server.
When files get checked in, I want TFS to build the website and push it over to a test server (uncompiled).
I have found many posts indicating that I should use a web deployment project, but that doesn't seem to be an option for VS 2012. I also found that VS 2012 is supposed to have better support for website project deployment (.pubxml) which I can get to work great from inside Visual Studio, but the TFS 2010 build wants a project or solution file.
I am new to TFS so I may be missing something obvious here.
Solution from the OP:
I figured out my issue. There was a file create called website.publishproj that I needed to put into source control before turning on gated check-ins. I could then use that file for "Items to build". TFS is at least now attempting to build the website. It looks like I have some more configuration issues to get through.

asp.net Attempting to create publish settings in vs 2012 gives strange error

I recently updated my asp.net 3.5 web project from Visual Studio 2010 to Visual Studio 2012. Every time I try to create publish settings it says the following:
{There are errors in web.config. Please correct these errors and try again.
The first error is: "Web.config appears to be in invalid state. Please correct it and try again."}
I have been unable to determine what this means. I have no errors in my web.config that it is telling me about. I have search for this error and have come up with nothing.
Can someone please help me out?
I should also mention this entire project resides on a mapped drive. I am still able to open the project and publish it in Visual Studio 2010 but can't even create the publish settings in Visual Studio 2012.
I think the below steps would help you out.
Before performing publish make sure the project is changed to Release mode.
Do not perform publish as a website. Try and publish your website to a file system.
create a virtual directory and point that virtual directory to the published folder.
The above mentioned steps worked for me.

Problems with 'Publish Web Site' on Visual Studio 2010

Recently I've upgraded from Visual Studio 2008 to Visual Studio 2010, however I'm having various problems when uploading my compiled web site to the live area. I'm doing exactly the same as I would have done with Visual Studio 2008, however, now I receive errors such as:
{filename}.aspx is not a pre-compiled file
masterpage.master does not exist
All these errors don't make sense. Has anyone encountered these problems before, and was a solution ever found?
Try run the Clean Solution command from the Build menu on your solution.
Try diagnosing by publishing to a brand new IIS location. Perhaps there are files from your VS2008 build that aren't being overwritten by your VS2010 build.
Are all the files present in the bin directory as you'd expect?
Is there an PrecompiledAppConfig.config file in the root?
You can run the Clean command by selecting Build -> Batch Build. You will see the options Build, Rebuild, and Clean in the dialog box.
The web site does not have to be created in IIS in order to use the Batch Build dialog.
Hope this helps,
Rick
you probably have not created an application or virtual directory on your server.
use IIS Manager to create it

Resources