Generate script assembly with strong name key file?

42 views
Skip to first unread message

lu...@rdr.leeds.ac.uk

unread,
May 24, 2012, 10:50:25 AM5/24/12
to CS-Script
Hi, if it's possible to generate a signed assembly from a .cs file,
what would be the best way to do it? Compiler option?

Cheers,
Luke

Oleg Shilo

unread,
May 24, 2012, 8:42:43 PM5/24/12
to cs-s...@googlegroups.com
You are correct, compiler options is the best way (in fact the only way) to do this. It is available as command line argumants as well as script embedded instructions. The compiler options are can be used in the script hosting scenarios as well. 

Cheers,
Oleg 

lu...@rdr.leeds.ac.uk

unread,
May 28, 2012, 5:06:57 AM5/28/12
to cs-s...@googlegroups.com, osh...@gmail.com
Hi Oleg,
Thanks for the info. My scripts now compile as signed assemblies. The purpose of doing this however, was to generate friend assemblies that could access internal classes of another assembly (e.g. MainAssembly). I haven't been able to get this to work. I have specified the output file in CSScript.CompileWithConfig as e.g. Script0.dll, and added [assembly: InternalsVisibleTo("Script0.dll, PublicKey=...")] in MainAssembly's AssemblyInfo.cs. It works when compiling within Visual Studio.

Could it be to do with temp output paths? If so, is there anything I can do to solve the problem?

On Friday, 25 May 2012 01:42:43 UTC+1, Oleg Shilo wrote:
You are correct, compiler options is the best way (in fact the only way) to do this. It is available as command line argumants as well as script embedded instructions. The compiler options are can be used in the script hosting scenarios as well. 

Cheers,
Oleg 

lu...@rdr.leeds.ac.uk

unread,
May 28, 2012, 7:08:24 AM5/28/12
to cs-s...@googlegroups.com, osh...@gmail.com
I fixed it. 
I removed the ".dll" in the InternalsVisibleTo declaration.

What a numpty :-P

Oleg Shilo

unread,
May 28, 2012, 7:29:39 AM5/28/12
to cs-s...@googlegroups.com
Same happens to all of us one ore twice :) 

I was just about start looking at your case...
 
Glad you solved it.  

Oleg
Reply all
Reply to author
Forward
0 new messages