lukebuehler / CShell

A simple, yet powerful, C# scripting IDE and REPL
http://cshell.net
Other
703 stars 97 forks source link

Unable to use external libraries via 'using' #16

Open bc3tech opened 10 years ago

bc3tech commented 10 years ago
  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. :)

lukebuehler commented 10 years ago

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.

bc3tech commented 10 years ago

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

B

Sent from my Windows Phone


From: Lukas Buhlermailto:notifications@github.com Sent: ‎5/‎19/‎2014 8:44 AM To: lukebuehler/CShellmailto:CShell@noreply.github.com Cc: Brandon Hmailto:brandon@bc3tech.net 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