Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Silverlight app doesn't generate XAP

I have created a new Silverlight app and it created a XAp file under the CLientBin on the Server side.

However after copying an existing project into the same folder and adding it to the solution, the XAP file is not being generated for the this assembly.

What am I missing?

Many Thanks,

like image 747
Houman Avatar asked Dec 10 '22 06:12

Houman


2 Answers

Do not attempt to modify your project/solution files manually unless you know exactly what you are doing :)

Adding it to the solution is not enough. You need to make a Silverlight relationship between the website and your Silverlight application.

  • Right-click on your website project and select Properties.
  • Choose the Silverlight Applications tab on the left side
  • Press Add...
  • Leave Use an existing Silverlight project in the solution checked and select the project you want to add from the Project dropdown.
  • Leave Add a test page that references the control checked if you want a separate test page for your application.
  • Press Add and you are done.

The website will now build your Silverlight application and include the output Xap file in its ClientBin folder.

Add Silverlight Application dialog

like image 76
Gone Coding Avatar answered May 16 '23 08:05

Gone Coding


You need to update your project files:

The Silverlight project file contains a parameter indicating a server project:

<LinkedServerProject>..\SLClient.Web\SLClient.Web.csproj</LinkedServerProject>

The Web application project file contains a list of the Silverlight application projects:

<SilverlightApplicationList>{97E56891-B97D-4588-8262-BFB7DC5FD6D2}|..\SLClient\SLClient.csproj|ClientBin|False</SilverlightApplicationList>

This value tells MSBuild to copy the XAP in the clientBin directory.

Take note of the supplied GUID. It can be obtained from the Silverlight app csproj file:

<ProjectGuid>{97E56891-B97D-4588-8262-BFB7DC5FD6D2}</ProjectGuid>

You can open the project files in Visual Studio by first unloading the project in the context menu.

like image 32
Eilistraee Avatar answered May 16 '23 07:05

Eilistraee