Simple example/base for new solutions #88

Merged
merged 2 commits into from May 18, 2012

Conversation

Projects
None yet
2 participants

Expro commented May 7, 2012

Something to help newcomers to work with JSIL. I took me some time befor I figured out how to set up new project and how link together all pieces, so I've created project with results of my efforts.

Owner

kg commented May 7, 2012

Great idea. A couple nitpicks:

Don't add 'Any CPU' configurations for the JSIL solution - this will break the XNA project support since it relies on being built as an x86 application. I may come up with a solution for this in the long run if JSILc actually needs support for running as a 64-bit application, but right now it works fine as x86.

Directly referencing the ID assigned to an assembly (like '$asm01') is fragile since those IDs can change between individual compiles. The right method looks like this:

var asm = JSIL.GetAssembly("AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
asm.MyNamespace.Program.Main([]);

Also, I recommend not doing manual copies of stuff like JSIL.Core.js or JSILc.exe around, since if they get out of sync, debugging is very confusing. I use the sysinternals 'junction' tool for this to create an exact mirror of the Libraries directory where I need it (for example, in jsil.org/demos/). If you don't want to install sysinternals tools you can use 'mklink', built into recent versions of Windows.

Expro commented May 7, 2012

Don't add 'Any CPU' configurations for the JSIL solution...

I see my IDE (SharpDevelop) did some work in background on its own, and now protects "Any CPU" configuration. I will leave JSIL.sln untouch then.

Directly referencing the ID assigned to an assembly (like '$asm01')...

This one comes from Wiki - I guess outdated source code example.

Owner

kg commented May 7, 2012

Yeah, Visual Studio loves to add configurations as well. I have to manually remove them pretty often.

Thanks for pointing out that the wiki is demonstrating that old pattern.

kg merged commit 703cefd into sq:master May 18, 2012

Owner

kg commented May 18, 2012

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment