Create Web Deployment zip file from TFS build - web

Using TFS 2010 and I have a build project consisting of 2 solutions. One is a MVC solution with web pages the other is a solution containing multiple projects. These are various WFC services. I have added the criteria to publish each project in both solutions.
If I build either of them from VS - I get the zip files created.
If I use msbuild from a command prompt and build the WFC solution - I get the zip files.
Same for the MVC.
I then have a build project that builds both solutions, and I have as parameters
/p:DeployOnBuild=true;DeployTarget=Package
When I submit that build - it completes. But in the "_PublishedWebsites" folder I only get a package for the MVC project.
I've tried a LOT of variations but can't get the WFC solution to create the packages for the projects. I even named the pubxml files the same in each WFC project and tried passing that in as another parameter but the same results - MVC is correct; nothing for the WFC.
Even tried changes to Debug|AnyCPU versus Debug|Any CPU (space added).
I am thinking I have some little thing off that is biting me - but I can't find it.
Appreciate any assistance!

The WCF projects need to have been created as Web Applications and not just Websites. The default behavior you want is only available in Web Application.
There is walkthough on how to do the conversion on MSDN (http://msdn.microsoft.com/en-us/library/aa983476(v=vs.90).aspx). I tend to modify the documentation to be an in place upgrade by creating a blank web application and copying the project file over the top of the existing location.
You can then open that new project in VS (giving you two views of the same thing) and then adding the hidden files. Once working you can then delete the WebSite project and you will be left with thebWeb Application that will output to _PublishedWebsites.

Related

Azure Website Continuous Deployment always picks up the wrong project

I have the following folder structure in my TFS online:
The folder names also match the project names in the solution.
Legend:
green dot: web api 2.0 project
red dot: class library
blue dot: console app added as a webjob to the web project
grey dot: console app only used for testing
Working folders for build definition:
The build definition was created automatically by connecting Azure to TFS online, and I have only changed the folder, so instead of the Team Project root folder, it points to the folder of this branch, containing the solution file and the folders in the first picture.
(This points to the folder which contains the solution files as well as all the subfolders from the first image.
Problem:
When I run a build, it always picks up the ExpiringRateCardsWorker project (even now the Web project has been renamed (both the directory and the project file) to start with an underscore, so it will be first alphabetically.
The deployment is successful, this is what I see in Monaco:
How can I make it pick up the web project?
Edit: Question was closed stating to be the duplicate of this. I have since tried the solution suggested there, but the /site/deployments folder is empty on the FTP, it doesn't contain the deploy.cmd, so my question is still not answered unfortunatelly.
I'm experiencing similar problem with deployment of MVC application to Azure using CD in VSO.
This problem is somehow related to WebJob Publishing mechanism.
For now I wasn't able to deploy my whole solution with WebJob in one go, but when I've deleted all webjob *.json files and Microsoft WebJobs Publish NuGet package from my solution, I've managed to deploy my MVC App normally.
I think I'll have to deploy this parts of the application separately, for now.

IIS/Visual Studio Publish Profiles

I know IIS allows the creation of Publish Profiles that can be "imported" into Visual Studio in order to upload a site directly into IIS (since I'm already using it).
But now I have a more specific question regarding the use of these publish profiles in Visual Studio.
I have a solution for a web application that comprises a couple different components that I'd like to keep sepparated in IIS.
Namely, I have the web version, a mobile version and a couple webservices in this project.
What I'm configuring the server to do is have the webservices, mobile and website separated into different sites and use different publish profiles to publish them, each into it's own place.
Since I have all of these components into a single visual studio project, would it be possible to have publish profiles that publish a single component of the project without requiring me to do a "full publish"?
Or is the only solution to have separate projects? (even if they are all in one single VS Solution)
Visual Studio's web publishing feature assumes that projects map to atomic components1. There isn't a way by default to specify how to only publish a subset of the project. Partly this stems from the build system (MSBuild) that the Web Publish Pipeline (WPP) is built over.
Options you can investigate:
Make your site contents match the structure in your project. Deployments are incremental (if coming from your machine), and you can deploy specific files or folders from the VS Solution Explorer. If you need to republish your binaries, you're still stuck doing a full publish. Publishing individual files/directories is the exception to note 1 above, and only works for content file changes.
If you're up to the challenge, you could dig your way through the WPP targets (it's all MSBuild), and try to find a way to restrict which files are published. Then you could set up separate publish profiles within your project that each only handle a subset of the files.
The easiest way, especially if you're automating this, is probably just to use separate projects for each component. :(

Restore sharepoint 2007 website on a different sharepoint 2007 server

I'd like to update existing production moss2007 website and to do that I want to create this website on my dev environmen (vhd win 2003EE, MOSS 2007 trial version).
I was given:
some stp files which include(aspx pages, javascript files, etc...)
some aspx pages, masterpage, css file
some wsp files
source code for almost all wsp files.
There is no documentation how to install all this stuff and I'm not a sharepoint developer but Asp.net dev in fact.
I set up local dev enviroment (i had no problems when following http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28
) and try to create a website based on given files.
My questions:
Do I need a copy of the database?
I noticed that one of wsp files is not a webpart but a project that contains some web controls and even a master page) - what should I do with it?
I tried to import all stp files. I had to use stsadm, but I can't see them. I can list them using "stsadm -o enumtemplates" - all of them have the same id!
I changed stp->cab->modified the "WebUrl" in the manifest.xml -> created new cab and rename it to stp-> imported to sharepoint but still the same, I can't see them (custom tab is still not visible).
I created a custom site template locally (custom tab appeared with it) and opened its manifest.xml. I noticed that the section contains 17 parameters (manifest.xml files from other stp files 9 parameters only).
I think that my SharePoint (Trial version) works in a different way and that's the problem.
Can it be?
What is the best way to create this site locally?
thx ahead for all answers
if you want to set up development environment containing the same functionality as your production server, you can duplicate your production site collection by:
Copying and attaching production SharePoint content database to your development environment farm
Backuping and restoring it by stsadm tool
By firstly you need to prepare your development environment. If you have any wsp solutions deployed on production farm, deploy it on your development environment.
Then if you prefer first option check this link
If you prefer second option check this link
But if you prefer backup way, you can catch some problems with version difference between production and development revilement, different updates installed, so different assemblies in GAC.
So I advice to use attach database way, it should upgrade attached database if it has different version automatically.
Just google little bit, may be you'll find more complete guide for attaching or restoring site collections. I just give you start point.

Publishing a Web Application from VS2012 is wiping out user content

I'm attempting to use Web Deploy to Publish a Web Application.
I want Visual Studio to delete any files that no longer exist, so I've checked the "Remove additional files at destination" setting in my Publishing profile.
However, I want VS to ignore the /Content/uploads folder, as it contains contents that my users have uploaded. Naturally, the contents are different in my development site than they are in the live site.
Unfortunately, I have been unable to discover a way to make Visual Studio ignore this folder when publishing (it wants to delete all of the content, since it doesn't exist in the project).
Does anyone know of a way to exclude specific folders on the target site from being examined by Web Deploy?
I had a similar problem, wanting to keep some files in the deployment package even though they're not part of the project.
Try to create a custom MSBuild target for this, that works for me.
Here is a Getting Started MSBuild reference
Hope this helps.
All the best.
I was unable to find a suitable solution for this issue, so I've created my own:
https://pubsync.codeplex.com/
PubSync enables quick and reliable file syncing for publishing Visual Studio projects.

Packaging multiple features into a single WSP solution file

I am working on a sharepoint feature which includes a couple of list definitions, 2 webparts, a feature receiver assembly and an InfoPath form.
I have to use WSPBuilder to package these, and the requirement is to package all these features into a single WSP solution file.
Now, WSP builder requires the deployment files in a particular folder structure, same as the 12 Hive of sharepoint.
My problem is that all my features were developed separately, and consist of multiple project files, and these are not necessarily in the same folder structure..
How do I use WSP Builder to package multiple features into a single WSP solution?
Maybe this will help: http://www.codeplex.com/wspbuilder/Thread/View.aspx?ThreadId=43125
Ultimately, I think you gain a lot of flexibility by building your own wsp files by using a tool like NANT.
There's no particular action you need to undertake in wspbuilder to have multiple features in the same solution package.
All you need to do is create a new folder for each feature under the 12\TEMPLATE\FEATURES folder inside your solution in Visual Studio and place the appropriate feature.xml file in that folder. For example, you may have:
12\TEMPLATE\FEATURES\FancyFeature\feature.xml
12\TEMPLATE\FEATURES\ReallyCoolFeature\feature.xml
... and so on.
Upon building the solution, wspbuilder will read the entire tree structure of your 12 folder and append the corresponding nodes in the wsp's manifest.xml file. The same goes for any other possible subfolders inside the "TEMPLATE" folder, including IMAGES, LAYOUTS, etc: at deployment time they will all be copied in the correct folder inside the real 12 hive, because the 12 folder inside your solution is meant to be a replica of the original one.
For a better understanding, create some folders and files inside your 12 folder in the visual studio solution, compile your project and look inside the generated manifest.xml file.
The simple answer is that you are going to have to copy all the files form the individual projects into one master project for your solution. As long as all your individual feature files are in the correct location in your '12' folder then you'll be good to go.
Note: You'll need to check all your references to any assemblies as this solution will create 1 assembly for all your custom logic.
I had trouble adding dlls to the wsp so I wrote a short article about it: How to Add DLLs to a WSP Solution
I usually have one project in the solution designated as the "main" one. I set the dependencies so that this "main" project is built last. Then for the other projects that I want to be included in the wsp package, I edit the "Post Build Events" to xcopy the contents of the 12 folder and that dlls built by the projects into corresponding folders for the main project. Then after I build the whole solution, I can build the wsp package for the main project and know that it contains everything.

Resources