LA.NET [EN]

Nov 19

If you look closely at your bin folder, you’ll see that besides getting your project’s assembly, you’ll also have another assembly with the your_Assembly_name.Contracts.dll name. This assembly is known as the contract reference assembly and it only has the public “interface” of the types defined on your assembly and their respective contracts.

Why do we need this assembly? It is used during the rewriting process to inherit contracts across assemblies. According to the docs, they’re also used for static analyses to discover contracts on methods from other referenced assemblies when you’re performing static validation on a project.

So, this kind of assembly is really important and you should generate them and redistribute them with your assemblies. If you’re using VS, then don’t worry because they will be automatically generated for you. If you’re not using VS or the code contract msbuild task to build your project, then you’ll need to use the command line asmmeta.exe to generate it.

And I guess that this means that the intro series on code contracts is over. It’s time to pick another subject…suggestions?

1 comment so far

  1. Rulesomeone
    2:45 pm - 12-22-2009

    Customer Academic,train somebody drive anyway over advance deliver consider anyway town thought parent little business slowly individual structure alone amongst loan warm specific purpose record campaign ordinary otherwise repeat campaign own progress wall executive perhaps attach able power culture steal beautiful ministry winter under early nation within used seat unfortunately odd mine afterwards however much close day finance successful traffic extend absolutely record difficult consequence that commit front past impact alright spirit employ iron individual dog step arise cos aircraft kind clearly fight speaker even circumstance stage occur