Tuesday, August 19, 2008

[C#, VS2008 ] One Solution, Mulitple Projects

So I was trying to create one solution which would act as a master build to build the multiple Silverlight projects we have on the go. I ran into slight issues when setting this up, so I thought I'd outline how I did it.

1. Create a "Blank Solution" project.
1a. File -> New Project
1b. Select "Blank Solution" from Other Project Types -> Visual Studio Solutions

2. Force VS2008 to always show the main solution.
This helps when adding existing projects, since for some reason the default in VS2008 is to make the first project you add to the solution the root... making it hard to add multiple projects. *
2a. Go to Tools -> Options [Show all settings] -> Projects and Solutions
2b. Check "Always show solution".

3. Add the desired projects.
3a. Right click the Solution in the solution explorer and Add -> Existing Project.
3b. Browse to select the csproj file from the desired project.
3c. Repeat a&b for all desired projects.

4. Setup any dependencies between the projects.
This step may not be needed if each project already has correct dependencies setup.
4a. Right click the Solution and go to "Project Dependencies"
4b. Select each project from the drop down and select any dependencies if they exist.

That should be it! Build your solution, and all the projects included in the solution should be built in the respective project folders.

* Thanks to Danny-T.co.uk


.

Thursday, August 7, 2008

[Silverlight] What is a .xap File?

So in my travels I bumped into a screencast, and in it, the presenter appended the .zip extension to the end of the .xap file and was able to open up a collection of files by unzipping it! I was like... woooooooah, that's something I didn't know.

What is an .xap file?
The .XAP file is a .zip compressed file that contains the client DLL for the Silverlight application as extra DLLs of assemblies that you are using in your application. This can be your own assemblies of user controls or assemblies that are not part of the Silverlight runtime by default that gets installed on the client.(2)
For more information regarding the files contained in the xap, most notably the AppManifest.xml file, please see the following blogs:
(1)http://pietschsoft.com/post/2008/03/Silverlight-Anatomy-of-an-XAP-file.aspx
(2)http://blogs.msdn.com/katriend/archive/2008/03/16/silverlight-2-structure-of-the-new-xap-file-silverlight-packaged-application.aspx


.