I have created a new Silverlight app and it created a XAp file under the CLientBin on the Server side.
Howev开发者_StackOverflower 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,
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 theProject
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.
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.
精彩评论