source code for Microsoft enterprise library for version 4.0

Vicky 1 Reputation point
2020-12-09T08:49:39.69+00:00

Hi,

I'm looking for the source code of the Microsoft enterprise library version 4.0. MS has published the source code for version 5.0 and 6.0. I have searched a lot on the internet but couldn't found for version 4.0

I cannot use version 5.0 or 6.0 because there are breaking changes. My requirement is just to get the source code and upgrade the .Net framework to 4.8

Kindly help.

Thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,906 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,626 Reputation points
    2020-12-10T03:09:30.897+00:00

    Hi vicky-3979,
    Since Enterprise Library 4.0 was released in May 2008, and it is already a retired version. Therefore, the documentation on Enterprise Library 4.0 is not updated and maintained.
    I found some documents about Enterprise Library 4.0 you can refer to.
    Enterprise Library 4.0 for Visual Studio 2008 released!
    Microsoft Enterprise Library 4.0 – May 2008
    >>upgrade the .Net framework to 4.8
    First, you need to be sure that have installed the .NET Framework 4.8 , and then the next step you need to do is to change your project's target framework to 4.8.
    Right click on your project in Solution Explorer, click Properties and in the Application view, change the Target framework to .Net Framework 4.8 by the dropdownlist below.
    More details you can refer to this document.
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentationto enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Cheong00 3,476 Reputation points
    2020-12-10T03:38:47.803+00:00

    As the NuGet page of the package does not have link to GitHub, and given this library was released at 2008, it's unlikely to have the source code made public for this project.

    There is one chance though, although I'm not very recommend it... use "ildasm.exe" to disassemble the 7 DLLs in the package

    md Microsoft.Practices.EnterpriseLibrary.Common
    md Microsoft.Practices.EnterpriseLibrary.Data
    md Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
    md Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging
    md Microsoft.Practices.EnterpriseLibrary.Logging.Database
    md Microsoft.Practices.EnterpriseLibrary.Logging
    md Microsoft.Practices.ObjectBuilder2
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.Common.dll /out=Microsoft.Practices.EnterpriseLibrary.Common\Microsoft.Practices.EnterpriseLibrary.Common.il
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.Data.dll /out=Microsoft.Practices.EnterpriseLibrary.Data\Microsoft.Practices.EnterpriseLibrary.Data.il
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll /out=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.il
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll /out=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.il
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll /out=Microsoft.Practices.EnterpriseLibrary.Logging.Database\Microsoft.Practices.EnterpriseLibrary.Logging.Database.il
    ildasm /tok /byt Microsoft.Practices.EnterpriseLibrary.Logging.dll /out=Microsoft.Practices.EnterpriseLibrary.Logging\Microsoft.Practices.EnterpriseLibrary.Logging.il
    ildasm /tok /byt Microsoft.Practices.ObjectBuilder2.dll /out=Microsoft.Practices.ObjectBuilder2\Microsoft.Practices.ObjectBuilder2.il
    

    And then do global replace with VSCode on the folder on

    " .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
    .ver 2:0:0:0" to
    " .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
    .ver 4:0:0:0"

    also

    " .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?....:
    .ver 2:0:0:0" to
    " .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?
    ....:
    .ver 4:0:0:0"

    and use "ilasm.exe" in .NET SDK to compile them again.

    ilasm /dll Microsoft.Practices.EnterpriseLibrary.Common\Microsoft.Practices.EnterpriseLibrary.Common.il /res=Microsoft.Practices.EnterpriseLibrary.Common\Microsoft.Practices.EnterpriseLibrary.Common.res /output=Microsoft.Practices.EnterpriseLibrary.Common.dll
    ilasm /dll Microsoft.Practices.EnterpriseLibrary.Data\Microsoft.Practices.EnterpriseLibrary.Data.il /res=Microsoft.Practices.EnterpriseLibrary.Data\Microsoft.Practices.EnterpriseLibrary.Data.res /output=Microsoft.Practices.EnterpriseLibrary.Data.dll
    ilasm /dll Microsoft.Practices.EnterpriseLibrary.ExceptionHandling\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.il /res=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.res /output=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
    ilasm /dll Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.il /res=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.res /output=Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
    ilasm /dll Microsoft.Practices.EnterpriseLibrary.Logging.Database\Microsoft.Practices.EnterpriseLibrary.Logging.Database.il /res=Microsoft.Practices.EnterpriseLibrary.Logging.Database\Microsoft.Practices.EnterpriseLibrary.Logging.Database.res /output=Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll
    ilasm /dll Microsoft.Practices.EnterpriseLibrary.Logging\Microsoft.Practices.EnterpriseLibrary.Logging.il /res=Microsoft.Practices.EnterpriseLibrary.Logging\Microsoft.Practices.EnterpriseLibrary.Logging.res /output=Microsoft.Practices.EnterpriseLibrary.Logging.dll
    ilasm /dll Microsoft.Practices.ObjectBuilder2\Microsoft.Practices.ObjectBuilder2.il /res=Microsoft.Practices.ObjectBuilder2\Microsoft.Practices.ObjectBuilder2.res /output=Microsoft.Practices.ObjectBuilder2.dll
    

    Now you can go on to include them in your .NET 4.X projects and see if anything breaks. (Although if there is no error in compilation, I believe there is high chance that it would work.)

    Note: I've tested the recompilation works, however I have no project on hand that uses these library, so I'll leave it to you to test if it works.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.