“The Operation Could Not Be Completed” – Solved!

For a while now I had been frustrated by Visual Studio‘s sudden decision to be un-cooperative when saving new projects, but have finally solved the problem! Or at least, that manifestation of the problem that was afflicting me.

The issue I was experiencing was baffling. Following these steps:

  1. Create new project from template project
  2. Save solution

Visual Studio would stubbornly and unhelpfully complain that “The operation could not be completed“. Upon checking the desired save location I would find that a solution directory had been created, but that was it. There were no other project or solutions files or folders.

As far as error information went, that was it. No further information was forthcoming. Even attaching another instance of Visual Studio debugger to the IDE process shed no light, with no apparent exceptions or other output to indicate why Visual Studio would be having any difficulty with what should be a simple operation.

Windows Event Viewer was similarly bereft of useful information.

Computer says ‘No’” would have been about as useful.

At first it only seemed to affect certain project types and I was able to work around that by working in other project types or on existing projects.

Googling the issue was an exercise in frustration in itself.

The variety of circumstances (and versions!) in which Visual Studio has exhibited this sort of stubborn refusal to complete an operation were manifold, and none of those scenarios or the proposed resolutions applied to my simple case (and unsurprisingly did not resolve my problem when I tried them out of sheer desperation).

But I made a breakthrough today!

I finally stumbled upon someone who had experienced apparently the same problem, but with a different specific project type.

It was also in an older version of Visual Studio (2010) than the one I was using (2012), but fortune favours the bold, and the suggested solution was trivial so I thought why not give it a try…

The solution being: Ensure that “Save new project when created” is enabled in Visual Studio settings.

And would you believe it, it worked!

Tags:

5 comments

  1. Sebastian Jänicke’s avatar

    In such a case I use Process Monitor. In most cases I see that a file could not be accessed, a path is wrong, …

    1. Deltics’s avatar

      I just re-created the original problem with Process Monitor keeping an eye on things and this simply seems to confirm some odd bug with this feature.

      It seems that Visual Studio simply expects there to already be a solution file when saving, but if you have turned off the option to save new projects when they are created then the solution file doesn’t exist and Visual Studio just gives up.

      I don’t know whether this is a general Visual Studio problem or only specific to certain templates, but it certainly seems to affect every template I have tried recently and I can’t think why it would be template specific. O.o

    2. Graham Arthur’s avatar

      Embarcadero have just announced a new product called AppMethod – basically it is RAD Studio but just the FireMonkey bit.

      http://techcrunch.com/2014/03/06/embarcadero-launches-appmethod-a-new-multi-device-development-platform-for-native-apps/

      Also REMObjects have announced a new version of Oxygene and a new product called REMObjects C# which is basically like Oxygene, but used C# rather than Pascal

      http://blogs.remobjects.com/

      Just wondered what your take was on both these announcements

    3. SilverWarior’s avatar

      I had similar problem like that several years ago when I bought new laptop and started using Windows 7 for the first time.
      At first I thought that was Delphi isue as I also started usind of Delphi XE2 which I just bought at that time also. I keept getting “file acces denied file in use” messages. But only for files which would be created by Delphi (dcu’s, dpr’s). Even starting the Delphi as administrator didn’t fix the problem.

      I was about to report a bug report to Embarcadero when similar problem ocured with another program (an image editing program).
      So I started to suspect that the problem might be caused by my AntiVirus software. So I tried temporarily disabling residentail protection but the problem still remained.

      But what seemed the most curious is that the problem manifested only when I tried to save a nonexisting file using a save file dialog.
      So I made a test program which used multiple different ways for creating files with multiple file extensions.
      And the only aproach that lead to problems was when I used System SaveFile dialog.
      This in the end gave me information that it has to be something wrong with Windows SaveFile Dialog or the way how it is implemented into programs.

      Anywhay after updating my Windows problems simply went away. Unfortunately I still don’t know what exactly was the cause and I wonder if I ever will.

      So I recomend that you try updating your windows with latest updates to see if that might fix your problems.
      Also try to see if you car recreate the isue with some other program which also use Windows SaveFile dialog. If you don’t sucseed in recreating this with some other software it is posible that VisualStudio uses its own SaveFile dialog which has same bogus code as Windows SaveFile dialog had.

    4. Gareth’s avatar

      Good to see you back! Be interesting to read your thoughts on this new AppMethod thing from Embarcadero? :

      http://techcrunch.com/2014/03/06/embarcadero-launches-appmethod-a-new-multi-device-development-platform-for-native-apps/

      http://www.appmethod.com

      http://www.embarcadero.com/products/rad-studio/appmethod-faq

      For me it signals the final death knell for Delphi – EMB trying to rename the cross-platform/FireMonkey stuff for the next generation to attract new devs to that product without having the “stigma” of the Delphi name attached to it and leave Delphi as the cash cow for the old folks to keep paying for over-priced updates every year.

Comments are now closed.