0

I can't seem to understand how it works. I see there is an option /assembly available to the Script# compiler which procuces a .dll file with the .js file as a resource. Here is an example from http://www.nikhilk.net/ScriptSharpIntro.aspx:

ssc /ref:sscorlib.dll /ref:Script.ScriptFX.Core.dll /debug /assembly:HelloWorld.dll /out:HelloWorld.js HelloWorld.cs

Can I get the same result using Script# Visual Studio templates? How do I enable this option for my Script# project?

1 Answer 1

1

There isn't a way to produce an assembly with script embedded in it.

I think the /assembly flag might be a remnant, or is there primarily for the script# compiler to know where the assembly produced from the same code as produced by the c# compiler exists.

If you want to embed the script in that assembly, you'll need to do a two pass c# build - in pass 1, there is a placeholder script, and then in pass 2, the real generated script.

Alternatively I can think of some approaches involving ildasm, add script resource reference, and then ilasm'ing to get back a new assembly.

What is your scenario? I am curious. I've debated whether to make the two pass build be supported out of the box... but never gotten around to it, since the embedding a script was a nice-to-have.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for clearing this out. I was a bit confused how the /assembly flag is supposed to work. Yes, it would be great to produce the embedded script assembly , but that is not an important feature. This is just what I always did with my *.js files - I would embed them into a single nice assembly and reference them via ScriptManager.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.