Sharepoint 2010 deployment problem - visual-studio-2010

I have a VS2010 solution with two projects, MyProject.Silverlight and MyProject.Sharepoint. I want to automatically deploy the .xap silverlight ouput into the VirtualDirectories\80\wpresources folder.
The sharepoint project has a single module which references the silverlight output xap file using "project output references". The sharepoint project is configured with the "WebApplication" assembly deployment target.
If I set the .xap deployment type to anything other than ClassResource, the file ends up where I would expect it to be. However, if I choose ClassResource (which is the correct one, right?), I cannot see it being deployd anywhere.
This seems to only be the case when I use the "project output references" option. If I manually add the xap file as an existing item and choose deployment type ClassResource, it ends up in the correct folder.
Any clues?

If you want the XAP to be deployed at VirtualDirectories\80\wpresources, why would you choose ClassResources ?
The resources get embedded within the assembly which probably you are not looking for.
http://msdn.microsoft.com/en-us/library/aa543289.aspx

Related

TFS 2013 Web Deploy and web API help pages

I am using Team Foundation Server 2013 and have the nightly build configured to deploy a web application. The web application is making use of the web API help pages which depend on the built in XML documentation files.
I currently have these XML files being output to the App_Data folder. These are not being copied to the server during deployment. I tried checking in the documentation files but when the build process tried to regenerate them it caused an access error as the files are read-only.
I currently have a placeholder text file inside the App_Data folder included in the project to ensure that the folder gets created but I have to manually copy across the documentation files in order for the help pages to work as intended.
What is the correct/best way of forcing these files to be copied?
Thanks
Ensure the project build order has the docs being built first. Right click on the solution and choose Project Build Order
Then add some MSBuild logic in your pubxml or wpp.targets file to add the generated help files to the FilesForPackagingFromProject ItemGroup.
http://sedodream.com/2012/10/09/VSWebPublishHowToIncludeFilesOutsideOfTheProjectToBePublished.aspx
Open the solution, right click on the .xml file, click Properties, for 'Copy to Output Directory' select 'Copy Always'.

Opening a Visual Studio 2010 project in 2012 what creates the backup folder and how to control it?

I have an issue. We are upgrading to VS 2012 at work. When we open a VS 2010 project Visual Studio converts the project. This is fine, because VS 2010 can still use the project (yay microsoft). However, there is a \Backup folder created in the solution directory. Is this being created as part of the migration? Is there any way to control it?
The reason I ask is that the process that makes this folder copies web.config files into the folder. If you then try to build the solution (these are MVC projects), we get a "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." error. The cause is that there is a web.config file in a subfolder instead of the root folder. We did not make and do not want this change, and cannot figure out how to control it. Deleting the Backup\Web.config file fixes the error. Renaming it from web.config to web.config.bak fixes the problem.
I don't really want to have to personally open and convert every single project, and don't want random people bumping into this problem. Any idea how to either stop VS from creating the Backup folder, or how to make it create them in the my documents studio folder etc? I can't find any setting to control this and can't find any good info.
By chance, are you using the MvcBuildViews property to pre-compile your views at build time? If so, this is why you're encountering this (since it does the pre-compile in the same directory, it doesn't filter out any of the files below the project directory).
Note that you will also encounter this issue if you use the Publish feature for this project. Publish copies the web.config under your intermediate build output directory (by default, obj/) before and after applying web.config transforms.
The good news is that in VS2012, or in VS2010 with the latest Azure SDK installed, pre-compile is now supported for Web Application Projects (including MVC). These settings are currently in the project properties, under the Package/Publish Web tab.
(this doesn't directly address your question about the Backup folder, but it was too long for a comment.)
There is no way to control it that I found. We had to go ahead and run through and convert every project to 2012 and delete the backup folders to prevent any other team from running into it.

Problems Building a WCF Project with TFS 2010

I have a WCF project with a single .svc file and some .config files in it. I'm trying to create a build definition in TFS 2010 that will copy these files to an IIS folder on another machine.
I've done similar things with other MVC projects using the CopyDirectory task in the build XAML template. In those, I copy from the _PublishedWebsites folder to the IIS folder. However, with the WCF project, there is no _PublishedWebsites folder.
So I tried updating the MSBuild script for the WCF project to create a _PublishedWebsites folder and copy the files to it. This works when I build locally in Visual Studio 2010. But when it runs on the TFS build server, it doesn't quite work.
What I see there is that in "C:\Builds\1\PROJECT\PROJECT (Continuous Build)\Sources\PROJECT\bin\_PublishedWebsites", I can see all the files.
I'm guessing this "1 folder" is a temporary folder used for building...? I'm not sure what it's used for. But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files. None of the files from the "1 folder" are there.
Note that this same solution also has a WiX project to create a deployment package. That seems to build fine, and shows up in the drop location with no issue.
"1 folder" is a temporary folder used for building
Yes. "1" is number of build agent(service that actually executes builds activities) on your build machine.
But when I look at the actual drop location for the build, in "C:\Builds\PROJECT (Continuous Build)\PROJECT_BUILDNUMBER\", I see nothing except log files.
- Usually "Copy Files To Drop Location" flag is responsible for that.

Is it possible to specify a sources folder in a Visual Studio project?

I am comming from the Java world where I usually worked with Eclipse and IntelliJ. Both IDE's allowed one to specify a folder in the project directory to be the root folder for my sources. Typically this was a folder named "src" or "source". In Visual Studio 2010 I found an option on the 'Build' tab of the project properties screen that allows me to change the output directory but I was not able to find something for the 'input' directory. Is it possible to define such an 'input' directory?
You can simply add directories into your project. Open up the project in Visual Studio -> Right click on the project -> Add -> New Folder.
You can also link files into the project while they reside elsewhere.
Besides that, using those directories is quite uncommon in .NET so you should think about adapting the common habbits of the new platform to successfully develop for the new platform. Special-purpose solutions tend to do more harm.
In visual studio you can define a "default" root for all your projects. You do so by going to Tools -> Options -> Projects and Solutions and setting the first textbox "Projects location".
After that, you should know and follow how .Net projects are arranged.
Let's say you are creating a website called "TestSite". You will have a root folder with that name, and in that folder you will have a solution file "TestSite.sln" and as many subfolders as the number of projects your solution will be made of. A common scenario could be the following:
TestSite.sln
TestSite.Bll
TestSite.Dal
TestSite.Web
That would be three projects, the first two of type "Class library" as they are your business layer and data layer, and the third of type "Web application" or "Mvc application" (which is much better).
You can reference the projects between them, and when you compile you get everything tied together.
Generally project sources is placed where the project file is.
In C++ projects you can specify include folders. In C#/VB you may edit .csproj/.vbproj file as text file and change what you want.
Also you can add existing items into project.
And read this article

Clickonce and app.config

I am installing a WPF Application using the ClickOnce deployment. There are certain settings in the app.config that need to be changed after the Application is installed. Although the app.config exists in the deployment folder as assemblyname.exe.config.deploy , after installing the application I can't seem to find it on the client machine so that I can change the settings.
Where do I look for it, any pointers?
Many Thanks.
The application configuration is located in here (replace <username> by the username, XP users look in "Document and Settings"):
C:\Users\<username>\AppData\Local\Apps\2.0
It's located in one of those semi-cryptic subfolders, but I'm sure you'll get it :)
You should use SlowCheetah (a VS extension). With this you can create a transformation for your app.config file based on your build configuration (i.e debug/release). Then when you publish with ClickOnce your app.config file (or any other XML file for that matter) will be transformed into the ClickOnce package which gets published. You can find a sample at https://github.com/sayedihashimi/slow-cheetah/tree/master/SlowCheetah.Samples/Wpf.Transform.
as per How to get folder path for ClickOnce application, you can get the folder of a running task by right-clicking it in the Task Manager (or for earlier versions of windows in Process Explorer from www.SysInternals.com)

Resources