How to add satellite assemblies to a project in Visual Studio
Asked Answered
B

3

2

I'm working in a project which references assemblies from a third company. These assemblies have satellite assemblies that I'm copying with a post-build event to the bin folder.

Is There a way to include those third party satellite assemblies into the project so I have not to care with the post-build events and maintaining the files?

Thanks in advance.

MORE INFORMATION: As the references have only resources they are not added as project references, actually I'm just copying them to the // folder. As each localized reference has the same name I would only be able to add it one time to the project's references.

Bolme answered 3/12, 2009 at 17:31 Comment(0)
S
4

I was researching a related problem and stumbled on this thread. Please note that referencing the satellite assemblies directly (via the 'add reference' dialog) is not the way to incorporate them into your application. In stead just make sure they are located in a folder hierarchy as suggested above (relative to the original location of the binary file they contain resources for).

The only file you add a reference to explicitly is the library itself. Do remember to set 'copy local' to true in the property window of the reference. The runtime will then make sure to pull resources from the file whose directory matches the system locale.

Siobhan answered 16/6, 2011 at 12:23 Comment(0)
M
8

It is automatic in the C# IDE. Setting Copy Local = True on the assembly reference ensures that the satellite assemblies get copied as well. In the C++ IDE it is a setting: Framework + References, Build properties category, "Copy Local Satellite Assemblies".

There's not enough info in your question to narrow down which IDE you use or why it wouldn't work for you. Maybe that 3rd party is doing something non-standard. Give them a call.

Manilla answered 3/12, 2009 at 17:55 Comment(1)
I have one DLL for each language and I can add only one time the reference at the reference dialog. For example, I have the a.dll and several folders called /en/a.resources.dll /es/a.resources.dll /it/a.resources.dllBolme
S
4

I was researching a related problem and stumbled on this thread. Please note that referencing the satellite assemblies directly (via the 'add reference' dialog) is not the way to incorporate them into your application. In stead just make sure they are located in a folder hierarchy as suggested above (relative to the original location of the binary file they contain resources for).

The only file you add a reference to explicitly is the library itself. Do remember to set 'copy local' to true in the property window of the reference. The runtime will then make sure to pull resources from the file whose directory matches the system locale.

Siobhan answered 16/6, 2011 at 12:23 Comment(0)
D
2

In the references, right click and select properties on your reference to the third party assembly.

Ensure that "copy local" is true.

If this is true, then it should copy the satellite assemblies, as this is the behavior I've experienced in Visual Studio.

Donela answered 3/12, 2009 at 17:57 Comment(1)
I have one DLL for each language and I can add only one time the reference at the reference dialog. For example, I have the a.dll and several folders called /en/a.resources.dll /es/a.resources.dll /it/a.resources.dllBolme

© 2022 - 2024 — McMap. All rights reserved.