Problem description:
Today, I encountered a strange problem. After using the factory model, I went out and couldn't find the Assembly:
Failed to Load file or assembly "tianyige. sqlserverdal" or one of its dependencies. The system cannot find the specified file.
Solution:
I have encountered such problems before. The problem is that the names of the assembly and namespace are confused. For example, the namespace is called sqlserverdal, and the Assembly may be called tianyige. sqlserverdal, or "sqlserverdal", will cause an error where the object cannot be found. The solution is to correspond to the Assembly Name:
Assembly. Load ("tianyige. sqlserverdal"). createinstance ("tianyige. sqlserverdal. Category"); find the corresponding DLL in the bin folder and confirm its name.
This time, the name has been matched. It seems that I have spent all my eyes on it. No error at all, but there is still a problem. Finally, copy the DLL file [tianyige. sqlserverdal] in the error prompt to the bin directory under the website app. The problem can be solved.
Reflection:
Why do I have to copy the file to the bin folder under the app? Is it because tianyige. sqlserverdal must be called directly during app generation?
You may encounter similar problems in the future ......