Search code examples
c#.netc#-4.0referencesystem.componentmodel

From where does the System.ComponentModel.Composition.dll is being referred in my system?


I have a C# project that generates some.dll and it references a bunch of DLLs, one of them is System.ComponentModel.Composition.dll which is found under C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0.

I built some.dll and deployed on a Windows XP system. The application that uses this some.dll runs normally. But when I try to look for the System.ComponentModel.Composition.dll under C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 on the Windows XP system, I could not find it.

I just want to understand how the application is running properly.

The reason why I want to understand it is, I built the some.dll in a different system and deployed on another Windows XP system. When I try to start the application, the application crashes with error:

Exception ::Could not load file or assembly 'System.ComponentModel.Composition.resources, Version=4.0.0.0, Culture=en-NZ, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

Solution

  • The reference assemblies are used at compile time. Usually, as here, to refer to assemblies that are installed as part of the .NET Framework. Which will place these assemblies somewhere under either C:\Windows\Assembly (for the GAC) or C:\Windows\Microsoft.Net.

    It would tend to suggest in this case that the machine with the component missing does not have the correct version of .NET installed.