Not a bug but an issue - setting up auditing from app.config to web.config

Posts   
 
    
LukeO
User
Posts: 58
Joined: 23-Jul-2007
# Posted on: 25-Jun-2008 01:56:03   

I've been using MBUnit to test my code. I've got auditing setup and it is working fine with MBUnit but when I move it to my web service (I'm doing WCF) it doesn't seem to be recognizing the injected auditing dll.

I realize I need to use fullname and I've tried many combinations.

So here goes: I'm using LLBLGen v2.5

My working app.config (top part)

<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- ENABLING DEPENDENCY INJECTION For more info read "LLBLGenPro Help - Depedency Injection mechanism"--> <section name="dependencyInjectionInformation" type="SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionSectionHandler, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27" /> </configSections>

<!-- SPECIFYING DI INFORMATION Comment/Uncomment assemblies to enabled/disabled Auditors injected to your EntityClasses For more info read "LLBLGenPro Help - Depedency Injection mechanism" -->

<dependencyInjectionInformation> <additionalAssemblies> <assembly filename="RAMFrameworkAuditors.dll" /> </additionalAssemblies> </dependencyInjectionInformation>

My possibly non working web.config

<?xml version="1.0" encoding ="utf-8"?> <configuration> <configSections> <!-- ENABLING DEPENDENCY INJECTION For more info read "LLBLGenPro Help - Depedency Injection mechanism"--> <section name="dependencyInjectionInformation" type="SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionSectionHandler, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.5.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27"/> </configSections>

<!-- SPECIFYING DI INFORMATION
Comment/Uncomment assemblies to enabled/disabled Auditors injected to your EntityClasses
For more info read "LLBLGenPro Help - Dependency Injection mechanism" -->
<dependencyInjectionInformation>
    <additionalAssemblies>
        <assembly fullname="RAMFrameworkAuditors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null "/>
    </additionalAssemblies>
</dependencyInjectionInformation>

Is there something else I'm missing?

Thanks, -Luke

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 25-Jun-2008 11:14:33   

In Visual Studio, the assembly name can be viewed and changed through the project's property pages dialog box

Having said so, then you should be using the following:

eg.

<assembly fullName="myAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> 
LukeO
User
Posts: 58
Joined: 23-Jul-2007
# Posted on: 25-Jun-2008 20:02:35   

I'm doing that (see bottom part of previous post). For some reason the AuditorToUse is null.

Walaa wrote:

In Visual Studio, the assembly name can be viewed and changed through the project's property pages dialog box

Having said so, then you should be using the following:

eg.

<assembly fullName="myAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> 
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-Jun-2008 05:20:42   

The myAssemblyName.dll should be present at bin folder. Did you add the Auditor project or Auditor assembly reference to your service?

David Elizondo | LLBLGen Support Team
LukeO
User
Posts: 58
Joined: 23-Jul-2007
# Posted on: 26-Jun-2008 11:39:01   

It is. I've checked the name and version number also. I added the auditor project to my service but the dll is still being copied to the bin folder. What would be the difference between that and adding the assembly reference? I did the same with my MBUnit test project without any issues.

I've also tried stopping and restarting IIS after each build.

Another test I did was to assign a newly created auditor to a newly created entity using the AuditorToUse property and that too didn't work.

Do you know if something with IIS or WCF may be preventing this?

daelmo wrote:

The myAssemblyName.dll should be present at bin folder. Did you add the Auditor project or Auditor assembly reference to your service?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 26-Jun-2008 15:49:28   

I think the following thread might be helpful here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=13609

LukeO
User
Posts: 58
Joined: 23-Jul-2007
# Posted on: 02-Jul-2008 23:55:26   

I looked into that and while it was on topic the issue is perhaps different. I took so long to respond because I thought upgrading to version 2.6 would help since I'm using NET 3.5 WCF. It didn't.

So I'm trying to isolate this down and here is what I did.

I wrote a service method that creates a new entity and saves it. It is triggered via WCF but the entity is NOT transferred over the wire.

There is no audit record for this entity even though if I do the same thing with the same auditor on a strictly winform application it works. The only thing different between the two is that one is using IIS and the other a winform (technically MBUNIT) and therefore one is using web.config and the other app.config.

-Luke

Walaa wrote:

I think the following thread might be helpful here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=13609

LukeO
User
Posts: 58
Joined: 23-Jul-2007
# Posted on: 03-Jul-2008 02:00:41   

I got something to work but I'll respond with a more through answer a little later. I'm trying to narrow some of the issues down.

LukeO wrote:

I looked into that and while it was on topic the issue is perhaps different. I took so long to respond because I thought upgrading to version 2.6 would help since I'm using NET 3.5 WCF. It didn't.

So I'm trying to isolate this down and here is what I did.

I wrote a service method that creates a new entity and saves it. It is triggered via WCF but the entity is NOT transferred over the wire.

There is no audit record for this entity even though if I do the same thing with the same auditor on a strictly winform application it works. The only thing different between the two is that one is using IIS and the other a winform (technically MBUNIT) and therefore one is using web.config and the other app.config.

-Luke

Walaa wrote:

I think the following thread might be helpful here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=13609