C# VS 2010 Find All References not finding everything - c#

Using VS 2010 C#.
I went to use Find All References and noticed it was only searching and listing files that were open in VS. I'm positive what i am looking for is used in may places.
I know its working incorrectly, cause I'll open another .aspx file that uses it and it will then show up in the list.
I read some older posts on deleting the .ncb file, but the only on my computer is in a completely separate project and solution and folder.
Any suggestions?

Try deleting your bin and obj folders and then recompiling and see if it works after that point.

Related

Check In: Operation not performed Could not find file *.csproj.vspscc

I am having issues with check in my code files because of some changes I have made to the project and solution. I have renamed project files, added different project files in the solution and added many files in the existing project.
Now I am getting an error while checking in the code.
The error details are:
Check In: Operation not performed Could not find file
'....Console.csproj.vspscc'.
How do I create a vspscc file if it does not get created on its own?
Any help would be great and thanks in advance.
This looks pretty stupid on my part. I restarted my Visual Studio and I could perform the check in because Visual Studio created the vspscc file when it opened the projects and solution.
Answering my own question as fast as possible so nobody else prints my own negligence before me.
And for anybody who needs an answer as how to create a vspscc file, restart the visual studio IDE
I have also seen this in another situation (VS2012) where a simple restart didn't do the trick.
I had a number of new projects which I had added to an existing solution but in the wrong place. Undoing and re-adding seemed to be fine until check-in, where it complained that the newly added projects and related .vspscc files could not be found. It was looking for them in the original location rather than where they are now.
Resolution was to go to the Source Control Explorer, which still had check-in items against these files in their original (but non-existing) locations, as well as the files in their correct locations. Selecting these errant references and "Undo pending Changes" for these files did resolve the issue.
I'd try using File/SourceControl/ChangeSourceControl dialog and unbind (if necessary) then rebind the project to TFS to recreate the .csproj.vspscc.
I removed projects and have same issue, so my solution was to re-create the same projects with same name, then remove them cleanly :-) I hope this helps
I had a similar problem, but in my case I Visual Studio/TFS couldn't fine the .csproj file. Anyway, with the help of a colleague I was able to determine that the issue was within TFS itself. TFS may have a different view of your source code than Visual Studio does. I had created the wrong type of project (I'll call it Proj1) and deleted it from within VS. Then created the correct project type, which I'll call Proj2. When I when to check it into TFS it complained about Prog1.csproj, which confused me because I couldn't see it within VS. What I learned was that you have to go into TFS's Source Control Explorer. From there you'll see how TFS sees things. Sure enough, there was Proj1.csproj (and some other related files to Proj1). What I had to do within Source Control Explorer was undo the pending check-in's of those files and folders which I didn't want to check in and no longer existed anyway. Then TFS was happy and I could perform the check-in.

One file keeps opening in visual studio IDE

I'm using Visual Studio 2010
In one solution I have A.XAML file and it keeps opening every time I start solution. It also opens at some random time - I have no exact explanation.
It's very annoying. Why would VS open specific file by itself?
Does it open even when you create a new project? How about locating the file and renaming it does it help the problem? Also, have you tried to backup and remove the content of C:\Users\<your_username>\AppData\Local\Microsoft\VisualStudio\?
Update 1 based on comments:
So when you renamed all your A.XAML to B.XAML, do you get the A.XAML appearing or do you get a B.XAML file? Do you have many instances of the A.XAML file on your computer? If there are many, rename them differently so that you can subsequently identify the guilty one. Have you tried to 'Repair' VisualStudio through 'Add Remove Program' in Control Panel? Can you locate the A.XAML string in Regedit.exe? I think it could be useful if you would create a dummy project and ask a colleague or, friend to open it on their computer? (It would be helpful to get have a sample of that dummy project in order to troubleshoot whether it is the Project or, the IDE or, the OS which is the guilty party)
Update 2 based on further comments:
Recreating the .SUO file of the project fixed the problem. For example, renaming the .SUO file to .BAK and re-opening the project in Visual Studio.
What worked for me was running Visual Studio installer and choosing the repair option.
I had a whole solution that always opened a few seconds after I open any other solution. I didn't want to delete the solution so I thought I should try repairing Visual Studio (using VS2019). Haven't had any issue since.
Seems like an 'intense' option but it was what worked.

Visual Studio 2010 error building, due to missing files

I've searched everywhere and I can't seem to find anyone with the same problem (although I'm sure people have made the same mistake in the past)...I accidentally deleted the contents of my Debug and Release folders. Now I am getting file not found errors. As a background, it's a Windows Forms Application in C#, and I'm running Visual Studio 10.
Here's the errors:
Unable to read manifest 'bin\Debug\projectName.vshost.exe.manifest'
Could not find file [pathName]\projectName.vshost.exe.manifest.
Before I was missing the manifest, I was getting an error that it could not find the other contents of the folder (the exe, the pdb, etc.), error MSB3113 (link)
Things I've tried (and some of them were far-fetched, I know):
I tried renaming bogus files for all the missing files
I tried to find the deleted files, but can't
I tried deleting all the contents of the Debug/Release folders and doing a clean build
I tried deleting the Debug/Release directories
Let me know if you can think of anything I could try out. My issue seems to be vaguely similar to this one.
Here's how I ended up solving the problem - turns out I included my bin and obj directories in my project. For anyone experiencing the same problem, simply right click and "Exclude From Project." After doing this, clean and rebuild your project, and you should be good to go.
In my case the file app.manifest was checked-out. This file is located in my Winforms project under Properties folder. I selected this file from Pending Changes window and did "undo pending checkout". After that the build succeeded. This happened in Visual Studio 2008.
Worked for me: Properties => Build => Generate serialization assembly => change from Auto to Off

Cannot debug under Visual Studio Express anymore

I used to be able to debug using Visual C# Express 2010 with no problem before. However, since I've opened my project using MonoDevelop (to port it under MacOS), I can't seem to be able to debug anymore.
The exact error message is available below:
A lot of people says to go in the configuration manager, which I'm familiar with, however, I can't seem to find it in the Express version.
Since you didn't have this issue prior to opening in Monodevelop, it more than likely changed something within the solution and/or project files. There are a number of posts on stackoverflow...
stackoverflow: no symbols
stackoverflow: no symbols when crossing module boundries
(From Răzvan Panda comment on the question)
... that talk about missing symbols. However, based on the information provided about monodevelop, I'd venture to guess that the IDE changed something within the solution and/or project files.
If your solution is under source control and you don't see any differences in these files, let me know. Otherwise, you could create a new blank solution/project file (from Visual C# Express 2010) and re-add all your files to it to get the default settings back and see if that resolves your issue.
EDIT: Also, keep in mind that there are ".user" files that I guess "might" have an effect on build/debugging configurations. If re-adding your files to blank solution/project files doesn't work make sure all the "extra" files like ".user" are not in the directory. Usually files like ".csproj.user", and ".suo". I've never had an issue deleting these they store local configuration changes that are not usually checked into source control.
I had same problem with Symbols when I added some dll to my project so what I did was to manually adding them. you can try going to tools > option > Debugging > Symbols and from there you can add the file root (in this case monoDevelop) and it automatically looks for all .pdb files and adds them to your environment. After rebuild it should be Okay.
Cheers
As George Duckett said:
Re. configuration manager, enable expert settings first. Tools->Settings->ExpertSettings. Then find it under Build->ConfigurationManager
Then changed it to Debug.

Object reference not set to an instance of an object. -Resources.resx

After converting my project into VS2010, everything looks fine ( gui, etc..), but i can't build it because of this error. When i double click on the error it leads me to the resource file but doesn't show me where the problem is.
Object reference not set to an instance of an object. -Resources.resx
My project works fine on VS2008, was built on .net 2.0 , does any one know how to fix this ?
Thanks
In my case this happened after copying a form from one project to another.
It seems VS lost the reference to one of the local resource images.
Re-adding the image fixed the issue.
Well, something got messed up, but without bashing your head around it too much:
Use row headers to select all rows in the resources file.
Copy the selected content to Notepad.
Delete the resources file in Visual Studio.
Create a new resources file with the exact name.
Copy/paste the content from Notepad back to the resources file.
That should do the trick. This only works with string resources. If you have other types of resources, I am afraid that simple copy/paste will not be as simple. Either way, I think that recreating the resources file is the easiest solution.
Principle: "Don't know, don't care. Just make it work" :)
I had the same issue when copying a windows form from one project to another. After some research I found that it was due to the version of the .Net Framework.
Make sure that the project where the resx file sits is the correct version. If you copied it from Project A to Project B, make sure that the .Net version of Project B is the SAME as Project A.
See http://www.codeease.com/object-reference-not-set-to-an-instance-of-an-object-in-resx-resource-file.html
Hope it helps you
I was moving project from XP 32 bit machine to 64 bit Win 7 machine. The project was Framework 2.0
In my case easy fix. In the resx file change all the Version=4.0.0.0 to Version=2.0.0.0
I got this problem when I worked from a network resource, even though I had write/read access too it. When I moved the files to a local folder, it started to work.
Something that often worked for me was modifying the resource files like this:
1. Go to the resource in design view and copy all the string entries.
2. Delete all the entries from the design view and save.
3. Go to the code view and remove the data entries/nodes (they were not removed on my machine, even though I removed them from the design view).
4. Rebuild the project.
5. Go to the design view and paste the entries you previously copied and save.
6. Rebuild and it should work.
Unfortunately my answer won't really help you, but is consistent with the ones above.
The errors (seemingly) spontaneously went away.
Here's some other info that might help... (I had two of these errors)
My scenario was I initially developed on VSexpress2010, 32bit XP. Recently upgraded to Win7 64bit. (clean install, bring all my code back in now...)
It seems this error is usually thrown by trying to reference some null object (I've lost the reference). So I tried this even though my code was working previously... No luck, but after I removed the new 'fix' code, the error for that object was gone. Just played around with the file.
I came across this page too http://www.codeease.com/object-reference-not-set-to-an-instance-of-an-object-in-resx-resource-file.html .
I searched my remaining resx, but had "Version=2.0.0.0". Anyway, after the search, I debugged and it's gone.
Short answer: It's like magnets, how the F##k do they work? Just play around with your file, and keep debugging... hopefully eventually it'll work.
recreate the resource file copy/pasting (assuming it's text)
make some edits in your file. save. remove the edits. save again.
search around the file.
chances are it's not your code, and some mystery VSbug.
Good luck.
+1 #Boris's answer because it really is a case of
"Don't know, don't care. Just make it work" :)
In my case I convert my project from framwork 4.0 to 2.0 and also copy a Form .cs file and Designer file after that I am getting same error.
But as I delete the .resx
The error gone.
Please try to delete .resx may it help you!
Problem occurred after an unspecified crash of VS-2010 which apparently corrupted the project.
The RESX file was not changed at all (as determined from a backup copy of the project). There seemed to be invalid references in the VSPROJ file. I was not sure how to correct them by direct edits.
As per "Rohan" in 2012. I removed a background image from a form and the problem went away.
In my case, the problem arose when I copied the project to a new location. The problem was solved when I copied all the resx files from the original project, after verifying that the project compiled fine, and pasting them into the folder of the project that had issues. Clearly, a corruption issue that seems to be common when copying projects to new locations.

Categories