5

I'm trying to compile an application for which I have the solution and can't get past:

'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

So I added the assembly to the GAC:

enter image description here

After some research I opened up visual studio with the Fusion Assembly Binding Viewer running, which seemed to create a lot of logs but none that related to this exact version of the assembly (however 4.1.0.0 is in there).

I can't simply add -> reference as VS tells me that a reference with the same name already exists.

What other avenues should I explore?

m.edmondson
  • 30,382
  • 27
  • 123
  • 206
  • Why don't you use EntLib 5.0? – abatishchev Nov 14 '11 at 10:56
  • This isn't my project, I just need to be able to compile it – m.edmondson Nov 14 '11 at 10:56
  • If there is an existing reference then try removing the existing reference and then re-adding it. Having the assembly in the GAC will make no difference at compile time. – Justin Nov 14 '11 at 10:58
  • There is an existing reference for `4.1.0.0`, if I remove that and add `3.1.0.0` I get the missing assembly message for `4.1.0.0` – m.edmondson Nov 14 '11 at 10:59
  • @Justin - If adding to the GAC won't make any difference at compile time how can I force it to take the assembly from there? – m.edmondson Nov 14 '11 at 11:16
  • 1
    @m.edmondson If you wish to reference two versions of the same assembly then you need to use an extern alias. See [.NET - Multiple libraries with the same namespace - referencing](http://stackoverflow.com/questions/4759726/net-multiple-libraries-with-the-same-namespace-referencing) – Justin Nov 14 '11 at 11:27
  • @Justin - But since I've been given this project as working I shouldn't need to modify the code – m.edmondson Nov 14 '11 at 11:39
  • Was the existing reference looking to the GAC? If it's looking to something like `C:\users\Alice\projects\someproject\lib` then that's going to fail. Remove it, then add a reference to whatever version that removed reference had been to. – Jon Hanna Nov 14 '11 at 11:48
  • @Jon - The reference was pointing to a directory - but if I remove then I get compile errors and if I put it back it's just the same as before – m.edmondson Nov 14 '11 at 12:01
  • As a side note the assemblies do not appear in the .net tab but I'm forced to reference on disk – m.edmondson Nov 14 '11 at 12:07
  • 1
    Compile errors when you remove it and put in a new reference to where the same version of the assembly is on your own system? – Jon Hanna Nov 14 '11 at 12:21

1 Answers1

1

Have you tried to Alias the assembly also if you are using .net 4.0 you would have to have an entry in the .config file for example that shows the old assembly name referencing the new assembly name. Several other things to keep in mind .. if the .DLL is in the GAC and you don't have a copy of that assembly in the bin folder, this could cause an issue..

Is this local referencing or is the code on a remote machine ..? if it's a remote machine.. why not add that specific assembly to the GAC.. notice the versioning difference of the two assembly's in your screen shot as well..

Paul Turner
  • 38,949
  • 15
  • 102
  • 166
MethodMan
  • 18,625
  • 6
  • 34
  • 52