Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
maybe this is a silly question but I really have trouble with this. I recently changed the icon that my project and my forms use. I did not overwrite the old file but used a new one. Now I want to delete the old icon from my ressources but if I try to compile I get an error saying that the old icon could not be found. I double checked all the forms and also changed the project icon in the project settings but I can't get rid of this error.

Do you have any advice on how to find all references in my project to this ressource so they can be deleted entirely? What controls besides forms could I have missed that use an icon?

I also tried just searching the whole project for the icon's file name but it comes out empty.

I am using Visual Studio 2012 Professional for VB.NET

Any help would be great. Thank you in advance.
Posted
Comments
Richard MacCutchan 17-Aug-13 11:56am    
The error message should also give you the name of the file holding the reference.
Keex0r 17-Aug-13 12:00pm    
Unfortunately not. Only the error description and Project name fields have information. No direct source is available.
Richard MacCutchan 17-Aug-13 12:05pm    
Edit your question and add the full exact text of the error message.

Project files are just XML, so I'd make a backup and then do a global replace in Notepad (or similar).
If I thought I'd need to do it many times I might write a utility to do it.
But always be sure to have a backup, project files can be fragile.
 
Share this answer
 
Comments
Keex0r 17-Aug-13 12:30pm    
Thank you. It was a line buried somewhere in the project file. It works now.
You don't really need to "find all references to resource". Your tool is the compiler. You try to build it and the compiler will show you the line where the removed resource is used. Fix that one (or more, if you can see more). Try again. Repeat until all the references are eliminated.

—SA
 
Share this answer
 
Comments
Keex0r 17-Aug-13 12:42pm    
As I said in response to the first answer, the compiler only showed the error but no source for it. It probably wasn't a direct reference but the fact that the file was just linked to the project somehow.
The line that caused it in the vbproj file was: <content include="Resources\Logoino.ico">
Sergey Alexandrovich Kryukov 17-Aug-13 13:11pm    
How "no source"? It looks like something pathological. Well, learn the problem. If something is in the resource, find the name of resource in auto-generated VB.NET file, it should be the static property with the name close to the name of original file. Perform total search for this string in your solution.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900