I know that this is really not a smart question, but I have some trouble understanding some working of Visual Studio 2010.
Programming a Windows form I needed to move a class (let’s say: class x) in a source (let’s say: a x.cs) file that was included in the main namespace and assembly to a different project (and assembly) in a different namespace. The latter is a dll aimed to gather utility classes. Probably I did this in a wrong way.
Symptoms is: When in the main form (code, not design) pressing F12 with the mouse over the constructor of the X class results in a new source “from metadata” being shown, including a class declaration (but still I can open the source code clicking on the right mouse button and selecting “show source code”). It seems that VS is unable to find the proper source code in the solution.
My questions:
- How can I recover from this having F12 points to the proper methods?
- More in general, what is the correct method to move code within different projects and/or assemblies?
I’ve just had a go at duplicating the described issue but it’s working fine for me. Let me describe the steps I took and maybe you’ll spot where you have done something different.
If it helps clarify things, here are a few images:
Solution Explorer:
Form1 Constructor:
Util class: