-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relocate ToDataTable #168
Comments
If you never use Also, I'm closing this as wont-fix because:
|
I understand not agreeing that it's a necessary change, but I do get the error. I've even tried with a very simplified environment. I created a new C# console app project in a new solution, deleted all standard references except System, added MoreLinq, and added this code to
I get a CS0012 when I try to compile. (using VS2013) |
@JamesFaix I tried the same but I guess the difference is coming from the compiler version in 2013 and 2015. Here's what I did. I created a simple using System;
using System.Linq;
using MoreLinq;
static class Program {
static void Main() {
Console.WriteLine(Enumerable.Range(1, 10).ToDelimitedString());
}
} Then I created a batch in the same folder with following the content and named it @echo off
setlocal
set NETFX=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
set CSC_PATH=%ProgramFiles%
if defined ProgramFiles(x86) set CSC_PATH=%ProgramFiles(x86)%
rem set CSC_PATH=%CSC_PATH%\MSBuild\12.0\bin
set CSC_PATH=%CSC_PATH%\MSBuild\14.0\bin
nuget install morelinq -version 1.4.0 ^
&& copy /y morelinq.1.4.0\lib\net35\MoreLinq.dll ^
&& "%CSC_PATH%\csc.exe" /noconfig /nostdlib "/r:%NETFX%\mscorlib.dll" "/r:%NETFX%\System.Core.dll" /r:MoreLinq.dll Program.cs ^
&& Program You'll notice that to be very strict on references, I disabled the default response file ( Depending on which C# compiler version you want to invoke, you can uncomment the corresponding
The first one reports CS0012 but second one doesn't. Output from running the batch in case (1):
Output from running the batch in case (2):
So while you're right that CS0012 is being emitted, I'm not sure if going forward it is an improvement (I hope) or a regression with the C# 6 compiler (I see 4 mentions of CS0012 in dotnet/roslyn#7278 at the time of this writing). In any event, I'm still not inclined to spend time and energy on moving out |
I propose that the
ToDataTable
method group be moved to a different assembly. Currently this is the only method group in MoreLINQ that has a dependency onSystem.Data
orSystem.Xml
. That's 2/3 the dependencies for 1/50 of the features, roughly.Code that has nothing to do with relational data, using MoreLINQ extension methods that have nothing to do with relational data, without referencing
System.Data
will yield the compiler error "The type 'System.Data.DataTable' is defined in an assembly that is not referenced..." A similar message occurs forSystem.Xml
The text was updated successfully, but these errors were encountered: