Home Dashboard Directory Help
Search

Code Analysis fails when using exposed type from Portable Class Library by Edward D. Brey


Status: 

Closed
 as Won't Fix Help for as Won't Fix


7
0
Sign in
to vote
Type: Bug
ID: 777463
Opened: 1/24/2013 8:09:53 PM
Access Restriction: Public
1
Workaround(s)
view
4
User(s) can reproduce this bug

Description

In a solution with two projects:

Project 1: A Portable Class Library supporting .NET 4.5 and Silverlight 5, which exposes a field or property of type from the .NET Portable Subset.

Project 2: A .NET 4.5 Class Library that consumes the field/property from Project 1.

The solution compiles fine; however, Code Analysis fails for Project 2.
Details
Sign in to post a comment.
Posted by Thomas Stocker li on 5/19/2013 at 2:44 PM
I found a workaround for the problem see in the other tab

Sincerly Thomas
Posted by Microsoft on 4/16/2013 at 12:12 PM
Hi Edward,

Thank you for taking the time to give us feedback. We won't be able to fix this Code Analysis issue for Portable Class Libraries in our next release of Visual Studio. We’ll continue to consider it for future releases.

Thank you,
Layla Driscoll
Sr. PM Lead, Microsoft Managed Languages
Posted by Microsoft on 1/25/2013 at 12:43 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by Microsoft on 1/24/2013 at 8:50 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Thomas Stocker li on 5/19/2013 at 2:43 PM
I found following StackOverflow help that fixes issues with Code Analysis and different Assembly Versions.

Here it is the same problem.

http://stackoverflow.com/questions/4042855/assembly-binding-redirection-and-code-analysis

So short solution:

Replace follwing line in your .*proj files with

Old:
<RunCodeAnalysis>true</RunCodeAnalysis>

New:
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
File Name Submitted By Submitted On File Size  
PortableCodeAnalysisProblem.zip 1/24/2013 5 KB