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

Missed dependency? #116

Closed
davidehnis opened this issue Aug 3, 2019 · 10 comments
Closed

Missed dependency? #116

davidehnis opened this issue Aug 3, 2019 · 10 comments
Labels
⚠ Bug Something isn't working as expected

Comments

@davidehnis
Copy link

Greetings! It looks like you may have missed a dependency. I had to install package "System.Reflection.TypeExtensions" to get it to work. Installing this resolved exception and it all works like a charm.

@daveaglick
Copy link
Collaborator

Interesting - what exact error were you seeing (at run time or build time?) and what was the target of the consuming application? It's entirely possible I need to adjust the dependencies for some set of consumers based on their target, especially if they're .NET Framework apps.

@daveaglick daveaglick added the ⚠ Bug Something isn't working as expected label Aug 13, 2019
@hrannzo
Copy link

hrannzo commented Sep 26, 2019

Happened to my as well while running console application targeting net472.

The code:

var manager = new AnalyzerManager();
var analyzer = manager.GetProject(projectPath);
var results = analyzer.Build(); // throws here

The exception info:

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
  Source=MsBuildPipeLogger.Server
  StackTrace:
   at MsBuildPipeLogger.BuildEventArgsReaderProxy..ctor(BinaryReader reader)
   at MsBuildPipeLogger.PipeLoggerServer`1..ctor(TPipeStream pipeStream, CancellationToken cancellationToken)
   at Buildalyzer.ProjectAnalyzer.BuildTargets(BuildEnvironment buildEnvironment, String targetFramework, String[] targetsToBuild, AnalyzerResults results)
   at Buildalyzer.ProjectAnalyzer.Build(String targetFramework, BuildEnvironment buildEnvironment)
   at Buildalyzer.ProjectAnalyzer.Build(String targetFramework)
   at Buildalyzer.ProjectAnalyzer.Build()

daveaglick added a commit that referenced this issue Oct 11, 2019
@daveaglick
Copy link
Collaborator

I added System.Reflection.TypeExtensions as a direct dependency to the next version (it was already coming in via transitive dependencies). Hopefully that resolves the issue - I'll close it out but please let me know if the direct package reference is still needed after upgrading to 2.3.1.

@vladimir-angelov-1337
Copy link

//System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
//File name: 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
//   at MsBuildPipeLogger.BuildEventArgsReaderProxy..ctor(BinaryReader reader)
//   at MsBuildPipeLogger.PipeLoggerServer`1..ctor(TPipeStream pipeStream, CancellationToken cancellationToken)
//   at Buildalyzer.ProjectAnalyzer.BuildTargets(BuildEnvironment buildEnvironment, String targetFramework, String[] targetsToBuild, AnalyzerResults results)
//   at Buildalyzer.ProjectAnalyzer.Build(String targetFramework, BuildEnvironment buildEnvironment)
//   at Buildalyzer.ProjectAnalyzer.Build(String targetFramework)
//   at Buildalyzer.ProjectAnalyzer.Build()
//   at HTMLXCompiler.Shared.ControllersBuilder.<FindTypesInProjectAsync>d__7.MoveNext()
//--- End of stack trace from previous location where exception was thrown ---
//   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
//   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
//   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
//   at HTMLXCompiler.Shared.ControllersBuilder.<GenerateControllersCodeAsync>d__6.MoveNext()

@daveaglick
Copy link
Collaborator

Hi @TriEdgeAI - what version of Buildalyzer is this (the latest?), what version of .NET Core (or Framework) is the app running on, and what’s the target of the project being compiled? That’ll help me get to the bottom of why you might be seeing this. Thanks!

@daveaglick daveaglick reopened this May 7, 2020
@vladimir-angelov-1337
Copy link

image

image

image

@vladimir-angelov-1337
Copy link

Is this useful?

@vladimir-angelov-1337
Copy link

I'm getting this

NU1605: Detected package downgrade: System.Reflection.TypeExtensions from 4.6.0 to 4.1.0. Reference the package directly from the project to select a different version. 
 HTMLX.VisualStudio -> Buildalyzer 2.6.0 -> System.Reflection.TypeExtensions (>= 4.6.0) 
 HTMLX.VisualStudio -> System.Reflection.TypeExtensions (>= 4.1.0)

When I tried referencing 4.1.0 manually as a NuGet package.

@daveaglick
Copy link
Collaborator

Very useful, thanks. I have an idea what the problem might be - I’ll check it out tomorrow and see if I can replicate/fix. Stay tuned.

@daveaglick
Copy link
Collaborator

I'm pretty sure this was fixed a while ago so I'm going to assume this issue is either resolved or no longer relevant. Please comment or open a new issue if that's incorrect and you're still having trouble.

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

No branches or pull requests

4 participants