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

Posted by user295479 on Stack Overflow See other posts from Stack Overflow or by user295479
Published on 2010-03-17T08:44:38Z Indexed on 2010/03/17 8:51 UTC
Read the original article Hit count: 543

Hello everyone, 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 auto-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.

© Stack Overflow or respective owner

Related posts about app-licenses

Related posts about fxcop