Double-click "app. config" in the Solution Explorer list and the following code is displayed:
1 <?xml version="1.0" encoding="utf-8" ?>2 <configuration>3 <startup> 4 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />5 </startup>6 </configuration>
Add the Code marked in red at the top of </configuration>:
1 <? XML version = "1.0" encoding = "UTF-8"?> 2 <configuration> 3 <startup> 4 <supportedruntime version = "v4.0" SKU = ". netframework, version = v4.5 "/> 5 </startup> 6 <runtime> 7 <gcconcurrent enabled =" true "/> 8 <assemblybinding xmlns =" urn: schemas-Microsoft-com: ASM. v1 "> 9 <publisherpolicy apply =" yes "/> 10 <probing privatepath = ". \ bin \ "/> // bin is the directory for storing DLL files 11 </assemblybinding> 12 </runtime> 13 </configuration>
Compile it again.
C # solve the problem that the EXE and DLL must be in the same directory