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

Possible problems with latest SDK not including dependencies alongside Microsoft.NET.Build.Tasks #49

Closed
daveaglick opened this issue Apr 9, 2018 · 6 comments

Comments

@daveaglick
Copy link
Collaborator

See dotnet/sdk#2108

If there's no easy resolution within MSBuild and the SDK does stop shipping the assemblies alongside, then we could potentially crawl up the SDK folders when assembly resolution fails:

private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
    // Crawl up from the _buildEnvironment.ToolsPath (or _buildEnvironment.SDKsPath?) to see if the missing assemblies can be located
}

This would probably need to go in AnalyzerManager so that the hooks only get added once. We'd also want to use a static flag to keep track of whether we've already added the hooks in the case of multiple managers. May need to consider making AnalyzerManager disposable too and unregister the hooks on disposal.

@ltcmelo
Copy link
Contributor

ltcmelo commented Jun 6, 2018

Hi @daveaglick, do you intent to act on this plan and, if so, when would that be? I guess the issue persists with 2.1...

@daveaglick
Copy link
Collaborator Author

Yep, not sure when I'll be circling back to Buildalyzer though (I tend to work my projects in sprints, so might be a couple weeks until I do work on this one). TBH, I haven't looked at the final 2.1 release to see if they did indeed remove the assemblies. If so, then this approach may be our only option.

@daveaglick
Copy link
Collaborator Author

@ltcmelo A new version 0.5.0 is hitting NuGet now - can you please take it for a spin and let me know if it resolves this issue for you?

@ltcmelo
Copy link
Contributor

ltcmelo commented Jun 16, 2018

@daveaglick, thanks for the heads up. I will try to give it a try this week and I'll let you know.

@ltcmelo
Copy link
Contributor

ltcmelo commented Jun 18, 2018

Hi @daveaglick, it seems that 0.5.0 fixed the issue, indeed. A colleague @vaiocosl verified and it works. Thanks!

@daveaglick
Copy link
Collaborator Author

Thanks for confirming!

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