I am working in a Web Project in Visual Studio 2008. When I hit F12 (or right-click and select Go To Definition) Visual Studio is consistently going to the Metadata file in
Symptom:
Visual Studio 2010 Ultimate was repeatedly failing to find references to functions, #defines, includes, etc when using the "Go To Definition" or "Go To Declaration" or "Find All References" features - oddly Intellisense was working.
Fix:
The .sdf file will automatically be rebuilt by parsing the include files in your solution
Below steps worked for me.
<Reference Include="">
Delete the line
<SpecificVersion>False</SpecificVersion>
or
<SpecificVersion>True</SpecificVersion>
Check "View - Object Browser" and if you see more than one assembly with the same name - that's why your getting this error.
For us it was a bug in VS 2019:
If you have ASP.NET "Razor helpers" in App_Code
folder the Visual Studio 2019 interprets that as a different assembly but with the same name, that hides the actual assembly.
There's no fix for that other than rewrite those helpers to partial views or HTML helpers (you will have to do that anyway if you plan migrating to .NET Core).
See this workaround on MS's site and please upvote the bug there so MS fixes it
https://developercommunity.visualstudio.com/solutions/1008795/view.html (please upvote)
Another reason why same assembly can be loaded twice in the object browser is if you have a unit-test project that starts iis-express process and never kills it properly.
1. close your solution.
2. delete hidden <name of the solution>
.suo file in folder where your solution's <name of the solution>
.sln file exists.
3. open your solution.
4. rebuild your solution.
I did all suggested steps but nothing has been changed then
finally
right click and add reference menu, project tab
Problem sorted. Hope this will help to some one.
After deleting dll files from Visual Studio first and adding them back manually from Solution Explorer --> Website --> Add --> Reference and enabling 32-bit Applications in IIS fixed it for me.