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

Could not load file or assembly 'System.Runtime, Version=4.2.0.0' or one of its dependencies #110

Closed
babula38 opened this issue May 16, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@babula38
Copy link

error

blow are some details which might help you.

  • Visual studio version:- vs2019 community latest preview.
  • Expression tree version:- took latest from the github release
  • .Net Framework used:- .net core 3.1 with xunit project.

below is the expression.

.Lambda #Lambda1<System.Func`3[MyExpression.lib.test.MyClass,MyExpression.lib.test.MyClass1,MyExpression.lib.test.MyClass]>(
    MyExpression.lib.test.MyClass $myClass,
    MyExpression.lib.test.MyClass1 $myclass1) {
    .Block() {
        .Block() {
            $myClass.MyProperty = $myclass1.MyProperty;
            $myClass.MyProperty = $myclass1.MyProperty
        };
        $myClass
    }
}

Do let me know if you some other information also.

@babula38 babula38 changed the title Getting error while using. Getting error while using it during debugging, i.e. clicking on the "Expression tree visualizer" May 16, 2020
@zspitz
Copy link
Owner

zspitz commented May 16, 2020

I'm not sure why this happens; but other people have reported it as well. (#103).

I haven't been able to duplicate this.

You can workaround this by installing the visualizer to the Visual Studio install path, instead of the subfolder under Documents, as described here.

@babula38
Copy link
Author

babula38 commented May 19, 2020

I have placed the dll inside Visual studio install path, i am getting the below error now.

Unable to perform function evaluation on the process being debugged.

Additional information:- 
Evaluation timed out

at Microsoft.VisualStudio.DebuggerVisualizers.Impl.VisualizerObjectProvider.Create(IVisualizerObjectProviderInternal visualizerObjectProviderInternal)
at ClrCustomVisualizerVSHost.ClrCustomVisualizerVSHostHelper.DisplayValue(IntPtr hWnd, SuccessEvaluationResultProxy evaluationResult, Int32 selectedIndex, DkmApiVersion protocolVersion)

But one thing i noticed, once i called the .Compile() on the expression it started working. Is this expected?

@zspitz
Copy link
Owner

zspitz commented May 19, 2020

Once you called .Compile() on the expression, you can open the visualizer on the original expression, not on the result of the compilation? That's rather strange.

Could you add a reference to https://www.nuget.org/packages/ExpressionTreeToString/ and call the ToString extension method on your expression?

// using ExpressionTreeToString;
Expression expr = ...
var tostring = expr.ToString("Object notation");

@zspitz
Copy link
Owner

zspitz commented May 20, 2020

A possibly relevant link: dotnet/standard#481 (comment)

@zspitz zspitz changed the title Getting error while using it during debugging, i.e. clicking on the "Expression tree visualizer" Could not load file or assembly 'System.Runtime, Version=4.2.0.0' or one of its dependencies May 20, 2020
@zspitz
Copy link
Owner

zspitz commented May 20, 2020

I've isolated this to the use of Costura on the debugger side; using Costura on the debuggee side doesn't cause a problem.

Also, the problem is only with .NET Core projects.

zspitz added a commit that referenced this issue May 20, 2020
@zspitz
Copy link
Owner

zspitz commented May 20, 2020

@babula38 Could you try the latest release? And install to the VS install path.

@zspitz zspitz added the bug Something isn't working label May 20, 2020
@babula38
Copy link
Author

@zspitz thanks, it is working now, if I install it in visual studio installer directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants