This post is for you if you are developing your Avalon Application with jsc intending to release it as following:
- Native .NET WPF Application
- Flash Player Application
- JavaScript Application
- WPF Browser Application (XBAP)
There comes a point in time when you would like to release it for testing. Releasing it as XBAP is somewhat more work. Here is what you will need to do:
- Create new WPF Browser Application project in your solution and name it as “~.XBAP” project where ~ is your original project name.
- Remove App.xaml
- Remove Page1.xaml
- Go to the ~ project properties, select Application tab, find Icon and manifest section and choose “Create application without a manifest”. This will allow you to reference an exe from your XBAP.
- Add a reference of ~ to ~.XBAP
- Add a reference of ScriptCoreLib.Avalon.dll to ~.XBAP
- Add Program.cs and the startup code. For me it looks like this:
using global::ScriptCoreLib.CSharp.Avalon.Extensions;
using global::AvalonUgh.Labs.Shared;
class Program
{
[STAThread]
public static void Main()
{
AvalonExtensions.ToApplication<LabsCanvas>();
}
}
- Now you may need to tweak your security settings. I needed to add FileIOPermisson to enable loading the assets. Actually if you want users to be able to use it you need to obey the Partial Trust Policy. That policy will not allow you to create FileInfo objects nor will it let you call the Assembly.Name property.
- As the last thing before sending it in for testing you need to publish it and you are done.
You can use this tool to copy your source code as HTML like I did.
Update:
If you are running apache then you wiill probably need to add a new mime type. Keep in mind – some low-cost web host wont let you do that.
.htaccess
AddType application/x-ms-xbap xbap