views:

22

answers:

2

alt text

This is what I get when I select "go to definition" in the ConfigTests.cs. But I expected to go to already opened Config.cs with actual declaration.
What did I do wrong?

+3  A: 

You added a normal assembly reference.
When you Go to Definition on a member not defined in your project (or in Project References), Visual Studio will generate a source file from metadata using Reflection.

Delete the reference, then re-add it as a Project reference (in the Projects tab).
If the project isn't in the same solution, put it there.

SLaks
Yes... My colleague added reference to a library, not to a project :-S Thank you
zerkms
+2  A: 

This seems to indicate that your reference to the Models assembly is via the compiled DLL, not via the project in the solution. Try the following in the Solution Explorer:

  • Expand (unfold) the “References” item of the main project in your solution.
  • Select “Models” and press Delete to remove it.
  • Right-click on “References” and choose “Add Reference”.
  • Select the Projects tab (not the Browse tab).
  • Highlight the Models project and click OK.

Of course, this assumes that the Models project is in your solution to begin with. If it isn’t, you will first have to add it by right-clicking the first item in the Solution Explorer (the Solution itself), choosing “Add”, “Existing Project”, and then choosing the right csproj file for the Models project.

Timwi
sorry, cannot check both, so just upvoted ;-)
zerkms