开发者

Mark assembly App_licenses.dll with AssemblyVersion (FxCop CA1016 rule)

I'm trying to fulfil FxCop's rules in my web site. Since I use some Infragistics controls I have a licenses.licx file that turns into a "app_licenses.dll" assembly after publication.

The problem is that this app_licenses.dll assembly does not comply with rule CA1016 (MarkAssembliesWithAssemblyVersion), and I should add an AssemblyVersion attribute to 'App_Licenses.dll'.

I found I can add an AssemblyInfo file to my web site and then reference it from the web.config file as following:

<compilers>

<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="C:\....\AssemblyInfo.cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">

<providerOption name="CompilerVersion" value="v3.5" />

<providerOption name="WarnAsError" value="false" />

</compiler>

</compilers>

AssemblyInfo.cs contains:

using System;

using System.Reflection;

using System.Runtime.InteropServices;

using System.Resources;

[assembly: AssemblyVersion("1.0.0.0")]

[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: NeutralResourcesLanguageAttribute("es-ES")]

NeutralResourcesLanguageAttribute worked for another au开发者_高级运维to-generated dll in the web site (app_GlobalResources.dll) for another FxCop rule, but app_licenses.dll seems to ignore the assembly info and still pops up the same CA1016 error.

Any help would be much appreciated.


I would ignore the rule. Not all rules make sense in all scenarios. That simple.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜