The class library has already been referenced in the Project class library, and it is no problem to build the solution, but in the post-code, when referencing other class libraries by using, build the solution or generate a single class library, it will be reported " could not find type or namespace" xxx " (Are you missing a using directive or a program reference?) "such as the error, has been written in the time of the ASP 1 times, when the solution is to re-establish a solution, and then re-reference the class library to the new solution, but today in writing WinForm is very strange, before and after more than half an hour, The answers on the web are almost "nonsense" because the answers are "normal" and what I'm encountering today is an abnormal situation.
Some personal views: (VS2010) 1. In addition to the normal case of reference, in the establishment of the class library with caution "Common" as the class library name, because the VS itself has a system Common, so try to avoid using Common, otherwise there will be some people very depressed problems. 2. When invoking a third-party control or other non-solution DLL, do not copy directly to the Bin folder, but rather by right-clicking the "Reference"---"Add Reference", WinForm I have not tried, Before referring to the custom control you wrote at ASP, I tried several ways, only to successfully navigate to DLL 3 by [Add]. Each class library has an "attribute," which allows you to set the assembly name, namespace options, where one option is important: "Target frame", The problem I came across today is the framework, which is generally consistent with the new solution, but here somehow my new WinForm form target frame has become: ". NET FRAMEWORK 4 CLIENT profile", perhaps for this reason, although a reference can be added, the using reference in the project will be error-changed to". NET FRAMEWORK 4 ", the problem is resolved, the figure is as follows
I would add that to a friend who is familiar with the VS may say "directly in the solution to find the corresponding class library, in its Debug folder copy the corresponding source DLL files to the target Debug folder", this is not possible, at least my side (VS2010) is not able to solve the problem
Hope to have a friend to the related issues
Reprint: http://blog.sina.com.cn/s/blog_4c8f1ac201013lxb.html
C # assembly introduces an invalid workaround