开发者

how to resolve this warning in ASP.Net application?

开发者 https://www.devze.com 2023-01-11 19:30 出处:网络
I get the following as a warning during build of my asp.net application: The predefined type \'System.Runtime.CompilerServices.ExtensionAttribute\'

I get the following as a warning during build of my asp.net application:

The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Sy开发者_运维百科stem.Core.dll'

How do i resolve this warning?


From this blog:

So the final solution was to use the InternalVisibleTo attribute in one of the assemblies. This means ExtensionAttribute only needs to be defined in one assembly. There's more info here on how to do that with strongly named assemblies since it's not completely straight forward.

Related question: C# Compiler Warning 1685


from MSDN

Visual C# Reference: Errors and Warnings Compiler Warning (level 1) CS1685

Error Message The predefined type 'System.type name' is defined in multiple assemblies in the global alias; using definition from 'File Name'

This error occurs when a predefined system type such as System.int32 is found in two assemblies. One way this can happen is if you are referencing mscorlib from two different places, such as trying to run the.Net Framework versions 1.0 and 1.1 side-by-side.

Based on this, we probably need to see the list of assemblies and their references to help you much.

0

精彩评论

暂无评论...
验证码 换一张
取 消