Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between assembly references

On some machines after add reference to assembly in csproj generated the next tag.

<Reference Include="Microsoft.Expression.Interactions">
  <HintPath>..\Libs.SL\Blend\Microsoft.Expression.Interactions.dll</HintPath>
</Reference>

But on some machines generated reference with version, culture, token and processor architecture:

 <Reference Include="Microsoft.Expression.Interactions, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\Libs.SL\Blend\Microsoft.Expression.Interactions.dll</HintPath>
</Reference>

Why is this?

like image 487
user1875783 Avatar asked Dec 04 '12 13:12

user1875783


People also ask

What are assembly references?

Reference assemblies are usually distributed with the Software Development Kit (SDK) of a particular platform or library. Using a reference assembly enables developers to build programs that target a specific library version without having the full implementation assembly for that version.

Is defined in an assembly that is not referenced?

When you get this error, it means that code you are using makes a reference to a type that is in an assembly, but the assembly is not part of your project so it can't use it.

What is a COM reference?

COM references are used to reference "legacy" COM libraries (COM is the framework used to connect components before . NET). "References" are used to reference . NET libraries (assemblies).


2 Answers

Extracted from msdn:

Processor architecture is added to the assembly identity in the .NET Framework version 2.0, to allow processor-specific versions of assemblies. You can create versions of an assembly whose identity differs only by processor architecture, for example 32-bit and 64-bit processor-specific versions. Processor architecture is not required for strong names. For more information, see AssemblyNameProcessorArchitecture. In this example, the fully qualified name indicates that the myTypes assembly has a strong name with a public key token, has the culture value for US English, and has a version number of 1.0.1234.0. Its processor architecture is "msil", which means that it will be just-in-time (JIT)-compiled to 32-bit code or 64-bit code depending on the operating system and processor.

Code that requests types in an assembly must use a fully qualified assembly name. This is called fully qualified binding. Partial binding, which specifies only an assembly name, is not permitted when referencing assemblies in the .NET Framework.

All assembly references to assemblies that make up the .NET Framework also must contain a fully qualified name of the assembly. For example, to reference the System.Data .NET Framework assembly for version 1.0 would include:

See more in source:

http://msdn.microsoft.com/en-us/library/k8xx4k69.aspx

like image 89
Carlos Landeras Avatar answered Oct 04 '22 18:10

Carlos Landeras


These lines don't help your application to find the right reference or make a fully qualified assembly name, these lines help Visual Studio to find the reference. Probably you will find these lines only if VS had problems to identify which dll to load.

This is, I know, not the answer that you're expecting :) but I hope it may help you to search in the rigt direction.

like image 23
Rafa Avatar answered Oct 04 '22 18:10

Rafa