Trying to Add Resource in Visual Studio 2010 Pro S

2019-05-11 18:45发布

I'm using Windows XP Professional SP3 and recently switched to Visual Studio 2010 Professional SP1 to work on a C++ project.

If I try to right-click on a project inside Solution Explorer and select "Add" >> "Resource...", I get this error popup window:

"The operation could not be completed. Unspecified error"

And then the only option is to click "OK".

Anyone else encountered this?

4条回答
干净又极端
2楼-- · 2019-05-11 19:09

So I'm not 100% sure of the exact reason for this, but it had something to do with the Code Browsing Info DB that I had disabled to speed up VS2010. Seems VS won't allow entering the Add Resource wizard if the Code Browsing Info DB is disabled.

Still with the DB re-enabled I got the hanging "Please wait while 'Resource Script Wizard' prepares to start. Click Cancel to end 'Resource Script Wizard'" prompt. Not sure how it finally disappeared, but I had to do a reboot and did close my Outlook mail client after the reboot while doing a couple more trials. Not sure if it has anything to do, but after that I was able to enter the Add Resource Wizard.

Maybe the good old Microsoft-style troubleshooting reboots still works after all these years.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-05-11 19:12

Yes i had same problem, the solution its simple, you should close resource file then u can insert another image resource, Visual Studio cant add ids to bitmap while the file steel open "resource.h"

查看更多
男人必须洒脱
4楼-- · 2019-05-11 19:17

I had this same problem.

Right clicking on the project, selecting Unload Project, then right clicking again and clicking Reload Project fixed it.

查看更多
戒情不戒烟
5楼-- · 2019-05-11 19:19

In my case, it was cause by Google Recaptcha control.

I'd generate ressource after my page was completed so he catch my recaptcha Control but added a weird tag in his XML document.

Here is what I propose to you, open your resources file using XML editor and check out if there is not a weird tags which is widely different than other one. Maybe for me it's recatpcha, but maybe for you it's another third party.

Check out mine what it looks like :

<!-- OTHER TAGS --->
<data name="aControlResource1.ToolTip" xml:space="preserve">
  <value />
</data>
<!-- 
     THIS IS THE NASTY TAGS ... REMOVING IT MAKE IT WORKS PERFECTLY.
-->
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="recaptchaResource1.ErrorMessage" type="System.Resources.ResXNullRef, System.Windows.Forms">
   <value />
</data>
<data name="anotherControlResource1.ToolTip" xml:space="preserve">
  <value />
</data>
<!-- OTHER TAGS -->
查看更多
登录 后发表回答