Incompatibility of Enterprise Library version

Topics: Logging Application Block
Aug 4, 2009 at 4:03 PM
Edited Aug 4, 2009 at 4:13 PM

Hello,

I have the following situation. I am working with an application that has the following characteristics: Microsoft .NET framework 3.5 SP1, ASP.NET 3.5, SQL Server 2005, Visual Studio Team System 2008 Development Edition, Windows Vista Ultimate SP1 and I have some tools installed such as the AntiXSSlibrary, etc. I have downloaded and read the documentation from the Enterprise Library 4.1. My application requires some blocks from this library e.g. Logging, Security, etc.

I found the Hands on laboratory and I have run the examples and they work pretty well but when I try the logging.dll from the Enterprise Library source that is possible to obtain Microsoft's site then I get the an error that mostly complains about version, capability to log and values that are required in order to use the logging functionality.

I cannot understand why my applications works with the DLL file (logging.dll) from the Hands ON laboratory but I cannot with the DLL from the Enterprise Library Installation. I have also done references to those libraries that are required, such as Common, Object2, etc. I am running the application as Administrator and even the documentation from the Enterprise Library mention which libraries are required, still the exception appears.

This does not happen with the library from HandsOn laboratory. My question is: Do I have to build or compile something else even do I have all the DLLs created when I install the Enterprise Library? What kind of permissions do I need even if I am running as Admin and the application creates the Event Log and Flat file using the Logging.dll from the Hands On Laboratories?

Thanks in Advance

Aug 6, 2009 at 5:12 AM
Edited Aug 6, 2009 at 5:33 AM

Hi,

What exact exception are you running to? Is it something like ... "The located assembly's manifest definition does not match the assembly reference"? If it is. Please see this FAQ item. http://entlib.codeplex.com/Wiki/View.aspx?title=Why%20am%20I%20getting%20the%20messages%2c%20%22Could%20not%20load%20file%20or%20assembly%22&referringTitle=Home

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Aug 6, 2009 at 7:01 AM

Hello,

 

Yes I have exactly that problem but after my post I continued looking for and also trying to see what was the problem and I found the link that you have just attached. Then I went to the blog of Tom and also to MSDN site and read everything needed. So now everything is working just fine.

I have two requests if possible. I would like to see if you have an example of application for ASP.NET that uses the Database logging block because I would like to extend my example for the course that I am doing with that part. I am actually planning to use also e-mail and maybe WCF but that will come a bit later.

The other request is more a question. So as understood the idea of the source code is to allow the extension of the library (if as developer I want it) in order to create customized behavior or more functionality, otherwise with the compiled DLL verion is enough for the functionality.  I have also understood that if I decide to use my own version then I have to point my configuration tool and also do the change in the registry which points now to the installed from the installation executable file, right?

 

Thanks very much and look forward to hear from you

 

Alan ramos

Aug 6, 2009 at 8:55 AM
Edited Aug 6, 2009 at 8:56 AM
Hi,

Glad to hear that you've solved your first problem. For your next item, Well send you a sample on your email. On your last item, to use your modified ent lib dlls you can just remove the value of the publicKeyToken(set it to null) of the ent lib entries in your config. Also, when you install the source code you have the option to build the source code, if you check that option, there will be a bin folder in the root dir (<Drive letter>:\EntLib41Src\bin), which has the config tool(similar to the installed) but it uses the unsigned assemblies, you can use that version of the tool to configure your app which uses a modified dll.

When you are using the modified ent lib dlls, the ent lib entries in the config will somehow look like this:

<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" />

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Aug 6, 2009 at 9:41 AM

Hello,

Thanks very much for your reply and help with the application that you have sent.

I have another thread and I might start a new discussion and this is something related to the Validation Block. Since I am integration different blocks and using other tools such MVC pattern and also AntiXSSLibrary I have quite a lot in my application. This is not bad just a bit interesting.

Now I have followed some of the hands on exercises that come in the validation module and everything works fine. I went to some basic stuff and move straight to ASP integration. It is actually very straight forward but when I tried with my application I run into the following problem, The "PropertyProxyValidator" is not recognized in my ASP.NET page. I tried to figure out what was the problem but I can see that I have imported and followed the hands on intructions as in the exercise however, I am using in my development Master Page and in the Design part I can simple not edit or add anything else.

Of couse I am using the right way Master Pages because I have the application up and running. What I am doing right now is to create laboratories for implementing the Enterprise Library Blocks and more stuff such as security, Forms Authentication, SQL injection, LINQ, etc. Then I have tried another thing and this is just that I created a single and empty web form and give no relation to the master page and then add the "PropertyProxyValidator" element and then the element is recognized in the page without problem.

Would it be possible to know what seems to be the problem. I don't think that this cannot be used together. That would go against Microsoft integration of solutions.

 

Look forward to hear from you and thanks once again!

 

Alan RAmos

Aug 6, 2009 at 9:56 AM

Hello Again,

 

I have found the problem and what happened is that I have forgotten to register the control manually and the command was like the follow at the top of the page. Now I go forward and continue testing and building exercises. This is really cool.

 

<%@ Register assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet" namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet" tagprefix="cc1" %>

Thanks very much

 

alan Ramos