Skip to content
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

DLL/Type Loading error #226

Closed
SlowLogicBoy opened this issue Feb 25, 2018 · 7 comments
Closed

DLL/Type Loading error #226

SlowLogicBoy opened this issue Feb 25, 2018 · 7 comments

Comments

@SlowLogicBoy
Copy link
Contributor

SlowLogicBoy commented Feb 25, 2018

Strange behavior can't figure out what's happening.
What I know is that when nuget that I reference, is dependent on other version of already loaded assembly it no longer can load types.

Only happens on my Linux machine, on Windows everything is fine.

Code:

#! "netcoreapp2.0"
#r "nuget: Castle.Core,*"

Console.WriteLine("Hello");
Process.Start("dotnet", "--version").WaitForExit();
Console.WriteLine("End");
user@user-pc ~/code/Test $ dotnet script --version

0.18.0
user@user-pc ~/code/Test $ dotnet --version
2.1.4
user@user-pc ~/code/Test $ dotnet script main.csx
/home/user/code/Test/main.csx(5,9): error CS7069: Reference to type 'Component' claims it is defined in 'System.ComponentModel.Primitives', but it could not be found
user@user-pc ~/code/Test $ dotnet script
> #load "main.csx"
Hello
2.1.4
End
>

Other nugets that also yield this error:

#r "nuget: Foundatio.Repositories, *"
#r "nuget: YoutubeExplode,*"

Loaded Assemblies are the same both ways.

@seesharper
Copy link
Collaborator

What you are saying here is that if you load the script via the REPL it works?

@SlowLogicBoy
Copy link
Contributor Author

That's right.

@seesharper
Copy link
Collaborator

@SlowLogicBoy Is this fixed by #235 or possibly related?

@SlowLogicBoy
Copy link
Contributor Author

SlowLogicBoy commented Mar 20, 2018

Nope, #235 did not fix this one.
Is it related? Can't tell, I think this one is something to do Linux version of dotnet, because this doesn't happen on windows machines.

Made a test PR for this issue. #238

@seesharper
Copy link
Collaborator

@SlowLogicBoy
I just tried this on my Ubuntu 16.04 machine and I am unable to reproduce this error.

#! "netcoreapp2.0"
#r "nuget: Castle.Core,*"

Console.WriteLine("Hello");
Process.Start("dotnet", "--version").WaitForExit();
Console.WriteLine("End");

yields the following output

Hello
2.1.300-preview1-008174
End

Environment:

dotnet-script version : 0.20.0

Product Information:
 Version:            2.1.300-preview1-008174
 Commit SHA-1 hash:  b8df89a54f

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.300-preview1-008174/

Microsoft .NET Core Shared Framework Host

  Version  : 2.1.0-preview1-26216-03
  Build    : f2c3216183d20416568a4bbf5bb7d153e826f153

Are you still seeing this?
If so could you try it on a clean machine ?

@SlowLogicBoy
Copy link
Contributor Author

I think, we can close this, this is because of my environment, since on docker and clean machines this works as expected, probably something got messed up when I upgraded dotnet package to preview one.

@seesharper
Copy link
Collaborator

Closing this as we were unable to reproduce the error.

Just for reference it could be related to #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants