Using "extern alias" with CS-Script

197 views
Skip to first unread message

todd...@gmail.com

unread,
Jan 27, 2013, 5:46:18 PM1/27/13
to cs-s...@googlegroups.com
Is there a way to use "extern alias" with CS-Script?  I tried something like this (with version 3.4.2.0) on Windows 7 and .Net 4.0:
 
//css_co /r:Alias1=Library1.dll /r:Alias2=Library2.dll
//css_ref Library1.dll
//css_ref Library2.dll
 
extern alias Alias1;
extern alias Alias2;
 
class Script
{
    // code here
}
 
But when I go to execute the script I get errors similar to:
csscript.CompilerException:
c:\foo.cs(7,1): error CS0430: The extern alias 'Alias1' was not specified in a /reference option
c:\foo.cs(8,1): error CS0430: The extern alias 'Alias2' was not specified in a /reference option
 

Oleg Shilo

unread,
Jan 27, 2013, 10:22:04 PM1/27/13
to cs-s...@googlegroups.com
The problem with your code that you reference both assemblies twice. Once with the compiler options (//css_co) and second time with the CS-Script directive //css_ref. your code will work if you just drop the //css_ref statements.

I have prepared the working sample for you: https://dl.dropbox.com/u/2192462/Support/toddlutz/toddlutz.7z

Cheers, 
Oleg Shilo
--------------------------------------------------------------------------------------------
Internet: http://www.csscript.net
E-Mail: csscript...@gmail.com


 

--
 
 

todd...@gmail.com

unread,
Jan 28, 2013, 11:45:12 AM1/28/13
to cs-s...@googlegroups.com, osh...@gmail.com
OK, but removing the //css_ref lines seems to break VS integration.  Is there a work-around for that?

Oleg Shilo

unread,
Jan 28, 2013, 10:48:29 PM1/28/13
to cs-s...@googlegroups.com
The debug*.cs script needs to be updated to support referencing from the compiler options and also to inject aliases. 

If you do not want to wait until the netx release then download again the sample archive. I've just added the updated version for the debug*.cs. Though I have tested it only with VS2012:  

--
You received this message because you are subscribed to the Google Groups "CS-Script" group.
To unsubscribe from this group, send email to cs-script+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages