Trying to Add Resource in Visual Studio 2010 Pro SP1 results in “The operation could not be completed. Unspecified error” message with C++ project

╄→尐↘猪︶ㄣ 提交于 2019-12-12 09:47:07

问题


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?


回答1:


I had this same problem.

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




回答2:


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.




回答3:


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 -->



回答4:


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"



来源:https://stackoverflow.com/questions/7605401/trying-to-add-resource-in-visual-studio-2010-pro-sp1-results-in-the-operation-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!