-
Notifications
You must be signed in to change notification settings - Fork 177
Bug/issue166 #169
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
Merged
Merged
Bug/issue166 #169
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2806730
Added test case for System.Data.SqlClient
seesharper b380424
Now works if we resolve as netcoreapp1.1 #166
seesharper b446e2a
Cleanup #166
seesharper 6cd3133
Fix dependency preference and test cleanup
seesharper 18e39cb
Removed launch config from test fixture
seesharper 4b2f43a
Merge branch 'master' into bug/issue166
seesharper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Dotnet.Script.Tests/TestFixtures/Issue166/Issue166.csx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! "netcoreapp2.0" | ||
#r "nuget:NetStandard.Library,2.0.0" | ||
#r "nuget:System.Data.SqlClient, 4.4.0" | ||
|
||
using System.Data.SqlClient; | ||
|
||
|
||
using (var connection = new SqlConnection(@"Server=tcp:dotnet-script.database.windows.net,1433;Initial Catalog=Sample;Persist Security Info=False;User ID=readonlylogin;Password=ztygpRhfjgej0we|dxHfxybhmsFT7_&#$!~<!n5,lfvtButr;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;")) | ||
{ | ||
connection.Open(); | ||
Console.WriteLine("Connection successful"); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question - shouldn't it work in the following way (I'm not sure myself, but I have vague recollection from
project.json
):I'm worried we may miss some dependencies if we just look into platform specific assembly group
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to do something like this.
now we do
The difference is that we get a much smaller
project.assets.json
file, but the semantics around how we read the dependency context also changes a bit then.What we get is a dependency context that is not tied to an specific runtime.
Think
dotnet run someassembly.dll
vs publishing to a specific platform that may even produce an exe for us to run on windows.What we do is look for a runtime assembly group that is specific to the platform. In the case of the
System.Data.SqlClient
package there are 3 assembly groups,win
,unix
and the group with an empty "runtime".Each of these groups point to asystem.data.sqlclient.dll
file If we don't find a group specific to the platform, we look for the one without an specified platform. What we did prior to this PR was that we preferred the one without a runtime identifier and that caused the PlatformNotSupported exception as described in #166 .Did that make any sense at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I wasn't clear.
The question was, isn't it possible in the layout of the restored packages, that the "empty" group would contain assemblies X and Y, but i.e. the "win" group would only contain X (windows version). This way we end up missing Y. Not sure if this is a valid scenario, but I somehow feel like it is? If an assembly in the "empty" group, doesn't have a counterpart in the platform specific group, it feels like it should be loaded too.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't know either. But the 99% case for all packages is that they contain a single assembly. Other assemblies are usually brought in through NuGet dependencies.
This package in particular brings in other assets, but that is native dll's that are processed separately. With this PR we don't bring in fewer dependencies, we just bring in the "right" ones :) But, I can't guarantee that the scenario you mention won't happen. It just hasn't happened yet and the more test cases we create covering a wider range of packages, the more certain we can be that we do that we do the right thing:) As I mentioned before we need to revisit this when adding support for script packages, but for now I would say that we are okay :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you would like to check the empty group for assets that is not the platform counterpart, we can do that. No problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's leave this as is, we can come back to that if it causes problems 👍