Postsharp4Entlib - PostSharp.Laos 1.0.4.166 DLL

Topics: User Discussion
Oct 30, 2007 at 1:48 PM
I'm having some trouble to get postsharp4entlib running. I keep on getting "Could not load file or assembly 'PostSharp.Laos, Version=1.0.4.166, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' or one of its dependencies. The system cannot find the file specified." while I referenced the dll.

I've got the current version of postsharp installed, which is 1.0.7.262.

I'm trying to call this very simple method:

class MyService
{
InjectPolicy("LoggingPolicy")
public void SayHello()
{
Console.WriteLine("Hi");
}
}

Here is the reference section from my .csproj file:

<ItemGroup>
<Reference Include="EntLibContrib.PostSharp4EntLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="PostSharp.Laos, Version=1.0.7.261, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL" />
<Reference Include="PostSharp.Public, Version=1.0.7.258, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

Any ideas what's going wrong?

Thanks,

Gerben.
Developer
Oct 30, 2007 at 2:59 PM
It's most probably because one of the assemblies still references the old version.
Try to rebuild all projects.
Gael
Oct 30, 2007 at 3:46 PM
Thanks for the quick reply Gael,

I was using the binary release from entlib contrib. I've downloaded the EntLib Contrib source and rebuild the PostSharp4Entlib project. I'm using this self compiled EntLibContrib.PostSharp4EntLib dll in my project now and it works fine.

When I switch back to the EntLibContrib.PostSharp4EntLib dll that shipped with the binary release I run into the same problem again. So apparently "EntLibContrib.PostSharp4EntLib" is referencing the old version and can't work with newer versions of PostSharp.Laos?

Thanks for your help,

Gerben.