Also, referring to the DLLs from the project, make sure that the Target Framework in the project properties is not less than the version of the Microsoft Enterprise Library:
- Enterprise Library 6.0-.NET Framework 4.5 (so you probably want Visual Studio 2012 - if you use 2010 / 4.0, you get an error message Failed to load the type 'System.Runtime.CompilerServices.ExtensionAttribute' from the assembly 'mscorlib' )
- Enterprise Library 5.0-.NET Framework 3.5
- Enterprise Library 4.1-.NET Framework 3.5
Also make sure that it is not configured for the client profile (for example, the .NET Framework 3.5 client profile), otherwise you will also get the same error.
As an aside, to download Enterprise Library 6.0:
- run the self-extracting executable file
EnterpriseLibrary6-binaries.exe - run loading script in PowerShell:
- run admin command line
- go to the directory containing
install-packages.ps1 - use
powershell -ExecutionPolicy ByPass -File install-packages.ps1
In version 5.0, you can download MSI and use the Universal Extractor if you do not want to install DLLs.
Sharc
source share