-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
FXCop Errors on VS 2015 #663
Comments
Do you have a repro where we can see this in action? We're currently in the process of trying to get things shipped with DNX compatibility so if we have to repro it ourselves it may take a while to get to. |
I’ll try to create one and get back to you |
This is a small project that exhibits the problem. It compiles without any errors or warnings on VS 2013 but show the errors mentioned above on VS 2015: |
Sorry, I'm new here, I didn't want to close this issue with my previous comment |
I'm also encountering this with Octokit, which has a PCL with Code Analysis enabled. It seems related to running MSBuild v14 - here's a sample log - the specific error is different because the code is different, but you get the idea... |
Thanks for the repro. I am able to see it, too, though the answer is currently escaping me. The reference to mscorlib 2.0.5.0 makes me think FxCop doesn't know how to properly deal with PCL dependencies or something. I'll keep looking at it. |
That's what I suspect is happening. As I don't believe it'll be fixed any time soon (and I can get away with it as I'm covered by platform-based projects) I'm going to disable the code analysis for the PCL project. Let me know if there's anything else I can do to help. |
Some searching reveals this is not entirely uncommon. AutoMapper has it but has not yet solved it... and it appears someone has even already opened a Connect issue specifically referring to Autofac in the discovery. I added a reference to this issue from the Connect page to help the MS team try to repro it and help solve the issue. |
@tillig I'll follow up there as well |
I reflected into the bowels of FxCop and tried out some of the undocumented/hidden command line parameters ( FWIW, the Autofac 4.0.0-beta5-90 build we have on NuGet that targets DNX, etc., doesn't raise these issues so it appears the trouble is specifically with PCLs built against the earlier tooling. |
@tillig nods |
Back in 2013 AutoMapper had a -as it seems- similar problem where an assembly couldn't be loaded because of a indirect reference to System.Core, 2.0.5. (AutoMapper/AutoMapper#383) |
I am not sure if the issue got resolved, but the problem here is that Autofac 3.5.2 targets .NET Framework v4.0, while the default PCL in VS2015 targets v4.5. You have couple of ways to fix your project:
|
Downgrading to ,Net 4.0 is not an option for this project. So I have tried to upgrade to the latest 4.0.0 build (4.0.0-beta7-130). |
Using the repro/sample solution I verified that this is fixed as of Autofac 4.0.0-beta8-154 (which is on the Autofac MyGet feed - I'm going to mark it closed. If you upgrade to 4b8 and still have a problem, post back here. |
…Autofac (autofac/Autofac#663) references #10
Hi,
I receive the following errors when compiling a PCL Library that uses Autofac 3.5.2 with VS 2015:
The following error was encountered while reading module '': Could not resolve member reference: [Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da]Autofac.ResolutionExtensions::Resolve.
And several times:
An error was encountered while parsing IL for method: '.PlatformServiceLocator.Resolve(System.Type)', instruction at offset '0xC' with opcode 'Call'.
And finally:
Could not resolve reference to mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes.
The machine is a fully patched Windows 8.1.
This project compiled without any errors on the same machine with VS 2013. This was present in VS 2015 RC as well.
Thanks in advance for your help
Best regards
Uwe
The text was updated successfully, but these errors were encountered: