The error message is as follows:
Create a dataconfiguration configuration sectionProgramError: failed to Load file or assembly "Microsoft. Practices. enterpriselibrary. Data, version = 2.0.0.0, culture = neutral, publickeytoken = NULL" or one of its dependencies. The Assembly list definition found does not match the Assembly reference. (Exception from hresult: 0x80131040)
Cause:
The Enterprise Library is signed and called by the application. The compilation can be passed and the program can run. That is, an error occurs when the Enterprise Library is called.
Solution:
In the following content of APP. config, modify publickeytoken = NULL to publickeytoken = your public key tag
<Section name = "dataconfiguration" type = "Microsoft. practices. enterpriselibrary. data. configuration. databasesettings, Microsoft. practices. enterpriselibrary. data, version = 2.0.0.0, culture = neutral, publickeytoken = NULL "/>
Change
<Section name = "dataconfiguration" type = "Microsoft. practices. enterpriselibrary. data. configuration. databasesettings, Microsoft. practices. enterpriselibrary. data, version = 2.0.0.0, culture = neutral, publickeytoken = c6e8e2756ff53597 "/>
The Public Key TAG method is as follows. For more information, see my blog.
1、use sn.exe to generate an SNK file [Sn-K Keyfile. SNK]
(The private key generated here is the private key used for your signature. if it already exists, it cannot be generated again)
-K [keysize] OUTFILE
Generate a new rsacryptoserviceprovider key of the specified size and write it to the specified file. Both the public key and private key are written into the file.
If you do not specify the key size and have installed Microsoft enhanced cryptographic provider, A 1,024-bit key is generated by default. Otherwise, a 512-bit key is generated.
2. Extract the public key to a file
[Sn-P Keyfile. SNK publickey. PK]
-P infile OUTFILE
Extract the public key from the key pair in infile and store it in OUTFILE.
3. The public key is displayed. Remember to use it later.
[Sn-TP publickey. PK]
-T [p] infile
Displays the mark of the public key stored in infile. The content of infile must be the public key previously generated from the key pair file using-P. Do not use the-T [p] Option to extract the tag directly from the key pair file.
Copy the content marked as c6e8e2756ff53597 from the CMD window and place it in your publickeytoken.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/cnming/archive/2007/07/15/1691714.aspx