Open atifaziz opened 7 years ago
Removing the .dll
extension gets rid of the errors in an interactive session:
Microsoft (R) Visual C# Interactive Compiler version 2.0.0.61501
Copyright (C) Microsoft Corporation. All rights reserved.
Type "#help" for more information.
> #r "System"
> #r "Microsoft.CSharp"
> #r "System.Core"
> #r "System.Data"
> #r "System.Data.Entity"
> #r "System.Transactions"
> #r "System.Xml"
> #r "System.Xml.Linq"
> #r "System.Data.Linq"
> #r "System.Drawing"
> #r "System.Data.DataSetExtensions"
>
> using System;
> using System.IO;
> using System.Text;
> using System.Text.RegularExpressions;
> using System.Diagnostics;
> using System.Threading;
> using System.Reflection;
> using System.Collections;
> using System.Collections.Generic;
> using System.Linq;
> using System.Linq.Expressions;
> using System.Data;
> using System.Data.SqlClient;
> using System.Data.Linq;
> using System.Data.Linq.SqlClient;
> using System.Transactions;
> using System.Xml;
> using System.Xml.Linq;
> using System.Xml.XPath;
> System.Console.WriteLine(
.
. );
Arguably, this is a C# Interactive issue as well since it has different behavior when running a script versus when issuing the content of the script in an interactive session.
C# Interactive issue reported to Roslyn (see dotnet/roslyn#18497). Hopefully this won't need any action on our end so putting it on hold.
What steps will reproduce the problem?
Create an empty LINQPad query file named
Empty.linq
then compile and run it as follows from a Windows Command Prompt (assuming current directory is same as where the query file is saved):The script should run without errors and emit a blank line. The compiled
Empty.csx
will look as follows:Run a C# Interactive 2.0 (
csi.exe
) session and copy the content of the compiledEmpty.csx
above and paste it into the session.What is the expected output? What do you see instead?
Expected the session to have the same behavior as running the script via the batch (
Empty.cmd
). Instead, the session emits errors for references to all system assemblies exceptSystem.dll
: