CShell icon indicating copy to clipboard operation
CShell copied to clipboard

Unable to use external libraries via 'using'

Open bc3tech opened this issue 10 years ago • 2 comments

  1. Create simple external library (DLL)
  2. Add the lib as a reference to the CShell workspace
  3. Add a 'using ___' statement to Scratchpad.csx for the namespace of the lib
  4. Notice no commands following the 'using' statement execute correctly:
using ClassLibrary1;

var c = new Class1();
c.SomeMethod();
[Evaluating external code (Scratchpad.csx)]
(7,0): error CS1525: Unexpected symbol `var'

classlibrary1 dll

I looked around the site, wiki, and Tutorial.csx and couldn't find any guidance on using external libraries, so if I'm doing something wrong one way to resolve this issue would be to add some doco to that affect. :)

bc3tech avatar May 16 '14 14:05 bc3tech

Yep, using statements should be executed separately right now. I usually have a file called usings.csx and add the using statements there. But this needs to be fixed to work properly, especially with the upcoming switch to the Roslyn/ScriptCs engine.

lukebuehler avatar May 19 '14 13:05 lukebuehler

Ah. Good tip. We should make this part of the current documentation/wiki.

B

Sent from my Windows Phone


From: Lukas Buhlermailto:[email protected] Sent: ‎5/‎19/‎2014 8:44 AM To: lukebuehler/CShellmailto:[email protected] Cc: Brandon Hmailto:[email protected] Subject: Re: [CShell] Unable to use external libraries via 'using' (#16)

Yep, using statements should be executed separately right now. I usually have a file called usings.csx and add the using statements there. But this needs to be fixed to work properly, especially with the upcoming switch to the Roslyn/ScriptCs engine.


Reply to this email directly or view it on GitHub: https://github.com/lukebuehler/CShell/issues/16#issuecomment-43505087

bc3tech avatar May 19 '14 13:05 bc3tech