If you are using Visual Studio to create Silverlight applications, and you wish to include files in your .xap as content, I found the following useful.

Open the .csproj file of the Silverlight application in notepad or another non-Visual Studio text editor and add entries to the XapFilesInputCollection ItemGroup in the MSBuild XML markup for each file you added to the AppManifest.xml file above. The following example assumes a content file named “MyFile.txt” is part of the output of the project, though this could point to any file you want:

<XapFilesInputCollection Include=”$(OutputPath)\MyFile.txt”/>

After recompiling, if you rename the .xap file output by Visual Studio using Windows Explorer to have a “.zip” extension and extract it, you’ll see your included file and its appropriate modified manifest file entry.

microsoft, products, silverlight, technologies

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: