How to configure a published package as a website in IIS - visual-studio-2010

I want to auto publish the sites using teamcity. I am using teamcity's Visual studio to publish a website. It creates a pre-compiled web directory as following
D:\publish\PrecompiledWeb\Books in the checkout directory.
Now I need to use it with IIS. If I point the IIS to that directory It gives the following error
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Any Idea what I am doing wrong.

I'm not entirely clear on the steps you're taking from your question, but it looks like your ultimate goal is to use TeamCity to create a deployable package and publish that to IIS. Your best bet is to do this using WebDeploy and fire it off from a Visual Studio build runner in TeamCity with appropriate parameters. There's a step-by-step guide to doing this in the You're deploying it wrong series.

Related

Publish from TFS 2013 to WebSite IIS : Failed with no error

At my company, we have received Team Foundation Server 2013 and Visual Studio 2013 to manage our code and deployment.
I'm trying to make it work but I can't figure out what I miss.
So here is the scenario :
I have a Web Application with no DB for the moment.
It's added to TFS and I have checked in everything.
There is a Build Controller on TFS.
On the Web Server, Web Deploy is installed and Management Services is there and allow remote management. The services are running. I have create a website but the folder with the source is empty for now.
My objective is to build on TFS and deploy from there in one single operation with the build definition.
Here is my problem, the build is working fine and everything is put in the drop folder. But it deploy nothing on the webserver and It raised no error on the build.
I tryied two techniques for the MSBuild arguments:
1) I create a publish profile in VS, when I publish from there it works but with this argument it does nothing:
/p:DeployOnBuild=true;PublishProfile=PublishIGU
2) I use this argument :
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://{serverWeb}:8172/msdeploy.axd
/p:DeployIISAppPath=IGUDEV /p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True /p:UserName=DOMAIN\user
/p:Password=XXXXX
And... it still does nothing.
I read a lot on the internet and follow tutorials but I can't figure this out.
Like I don't have any error message I don't know where to start.
Thank you if you see something that could help me.

Set Up Continuous Integration From VSO to Azure, but Website does not deploy

I have an azure website that I have successfully linked to a team project in VSO. When I go to the "deployments" tab of this site in azure management, it says:
The team project is linked. Visual Studio Online will build and deploy
your project to Windows Azure on your next check-in.
Below, it gives options to check in from VS2012 or 2010. I am using VS 2013.
In VS, I am able to check in changes and see those changes building in the cloud in the team explorer. My expectation is that after the changes build, they should be auto deployed to the website. This is not happening. I have made several checkins, and none are deployed to the website. It's probably that I have something configured incorrectly, but I'm not sure how to debug this.
In the Build Settings I am using the TFvcContinuousDeploymentTemplate.12.xaml build process template. One thing I did notice is that the under the Deployment Parameters, I noticed that Windows Azure Deployment Environment is empty, but if I try to populate that I'm not sure what to enter for "Web site name" or "Webspace" under the web site radio buttom.
I have followed instructions on these websites to no avail:
http://azure.microsoft.com/en-us/documentation/articles/cloud-services-continuous-delivery-use-vso/
http://channel9.msdn.com/Events/Build/2014/3-584
http://www.visualstudio.com/en-us/get-started/deploy-to-azure-vs.aspx
How can I check on the status of the deployment? How can I make sure that the project/solution is correctly configured to deploy/publish and not just build?
Some additional info:
To set up the continuous deploy, I goto azure management portal, click websites, open the website in question. Click the Deployments tab. It says "The team project is linked, Visual studio online will build and deploy your project to Windows Azure on your next check in". Under YOUR SERVER is lists the correct visual studio online URL for my source project (https://------.visualstudio.com). This is my first time trying CD. It has not successfully deployed yet, but the build is working. Every time I check in changes, a cloud build is triggered and it is successful.
I'm new to this, so I am likely making some unfounded assumption, but after going through the instructions multiple times I'm not sure what I can be missing.
Thank you!
l19 has the right idea in the comment responding to my post. I needed to specify a Windows Azure Deployment Environment. The website name is the name of the website. Webspace is a bit trickier, and unfortunately the documentation link in visual studio redirects to a not found page. This has to be precise (e.g., "west us" won't work). I was able to figure out the proper string by creating a new project from azure and associating it with vso from the start. In this case, the build definition was correctly configured. I opened the Windows Azure Deployment Environment and saw that the webspace was set to "eastuswebspace", so I used the same string in my real build definition and it worked.

How to configure Web Deploy 3.5 EncryptWebConfig rule handler?

We are wanting to setup publishing via the Web Deploy method in Visual Studio 2013. I've installed Web Deploy 3.5 on the destination web server and it's deploying properly.
We'd like to also use Web Deploy 3.5's EncryptWebConfig rule handler to encrypt our web.config files post-publish as described here: http://blogs.iis.net/msdeploy/archive/2013/07/09/webdeploy-3-5-rtw.aspx, which gives a command line example. However this is not an option in the "Publish Web" Wizard > Web Deploy Method , nor do I know how to add in that rule through directly modifying the .pubxml PublishProfile... Or is the EncryptWebConfig a rule I setup somehow in IIS on the server?
I was unable to find any further documentation on this rule anywhere...
I had also tweeted a guy who works for the Visual Studio Web team and he came through with this answer:
Add the property <MSDeployEnableWebConfigEncryptRule>true</MSDeployEnableWebConfigEncryptRule> to your .pubxml file
I figured it'd be like this, but previously could not find any references to the proper tag name, MSDeployEnableWebConfigEncryptRule, anywhere.

The virtual path ... maps to another application, which is not allowed. Team Foundation Server build fails

I have a WebSite project that builds successfully when running locally. I'm trying to setup Continuous Builds for this website in TFS (Visual Studio 2010) - when the build runs, it's failing with this error -
The virtual path '/abc/MasterPages/abc.master' maps to another application, which is not allowed.
Within my build agent, I'm not even trying to publish this to IIS - all I've configured it to do is to just run the build and copy the output to a specific folder.
Can anyone please let me know how I can get around this problem in TFS, as the same code runs successfully on all the developers' workstations?
Do you have publish information set as part of the project? If so remove it. Publish step needs to be done another way as part of a tfs build
Work around was to Prefix ~ in all relative URLs - for eg: '/abc/MasterPages/abc.master' will be '~/abc/MasterPages/abc.master'
That seemed to solve my problem.

Debugging an existing sharepoint solution

I've recently mapped a sharepoint solution from TFS to a local directory and successfully 'got' the latest version.
It wasn't building, but this was because of there were no Site URL's in the properties of the several projects included in the solution. So, using central admin, I created a new web app (the port 36352). U then added the url and port to the Site Url and it's now building fine.
However, when I go to run with the debugger I get the following two errors:
Error 2 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: :36352/">http://:36352/ (deleted url for security reasons). Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
AND
Error 3 Program 'Path.PowerShell.exe' (deleted path for security reasons) does not contain a static 'Main' method suitable for an entry point
It seems that the first error is related to the way in which I've 'connected' it to the new web app I've created - have I done this part right?
The 2nd error seems to be with regard to the entry point at which the debugger should execute, but this is a sharepoint site - so I just want to run the site (has VS not identified this as sharepoint somehow?).
Thanks a LOT for any help.
I got this exception when I had the solution on a different server. Make sure your solution is on the same server as the SharePoint web application. When you run the solution, Visual studio packages the solution and tries to deploy it onto the URL you specified in the properties. If your project is a farm solutions such as visual web part then make sure you have rights to deploy.

Resources