Blog Archives

How to fix “The operation could not be completed” error adding references to Visual Studio 2017

The Issue

Using Visual Studio 2017 and attempting to add a reference to a project you receive an error stating “The operation could not be completed”.

cameron-dwyer-vs2017-add-reference-error-01-add-reference

cameron-dwyer-vs2017-add-reference-error-02-operation-could-not-complete

The Solution

It seems that to bring up the Add Reference dialog in Visual Studio 2017 the Microsoft.VisualStudio.Shell.Interop.11.0.dll needs to be regsitered in the GAC. You can follow these steps to register this assembly in the GAC:

Open the Develop Command Prompt for VS2017 (ensure you run the as administrator otherwise the GAC registration may fail)

cameron-dwyer-vs2017-add-reference-error-03-dev-command-prompt-as-admin

Change the current directory to the PublicAssemblies folder for your Visual Studio 2017 installation. Mine was:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies

Note: this path will be different for different versions of Visual Studio (e.g. you may find your path is C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies)

cameron-dwyer-vs2017-add-reference-error-04-public-assemblies

Run the following command to register the assembly in the GAC:

gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll

cameron-dwyer-vs2017-add-reference-error-05-add-to-gac

Now restart VS2017 and try to add a reference to your project again and you should see the Add Reference dialog appear.

cameron-dwyer-vs2017-add-reference-error-06-add-reference-dialog-working

Advertisements

Fix SharePoint Performance Issue with ‘Open in Explorer’ & opening non-Office File Types

I was recently working with documents stored in SharePoint (Office 365 to be exact) and was seeing poor performance when trying to open file types with applications other than Office. At first I just put it down to a slow connection to Office 365, but I quickly realised that accessing files from Office 365 via alternate means (CSOM, Web Services) was much faster. I also found that the ‘Open with Explorer’ function (available on the Library ribbon as shown below) was slow to open.

cameron-dwyer-sharepoint-webdav-open-explorer-performance-issue-fix-01-open-with-explorer

 

cameron-dwyer-sharepoint-webdav-open-explorer-performance-issue-fix-02-explorer-webdav-view

In both scenarios I saw the performance issue (1) Opening non-Office files from SharePoint, and (2) Using the Open in Explorer function, the underlying technology that is performing the communication is WebDAV. WebDAV is the layer that makes it possible for applications that were not designed to work with SharePoint to.. well.. work with SharePoint I guess! WebDAV is actually a standard and isn’t SharePoint specific but I won’t go into that here. Suffice to say I’d isolated my issue down to being a performance issue related to WebDAV.

Now I knew what I was troubleshooting, the answer was readily available. Here’s the official KB of a known issue with WebDAV and the auto-detect settings option in Internet Explorer http://support.microsoft.com/kb/2445570

This was the fix for me:

In Internet Explorer, open Internet Options

cameron-dwyer-sharepoint-webdav-open-explorer-performance-issue-fix-03-internet-options

Select Connections | LAN Settings

cameron-dwyer-sharepoint-webdav-open-explorer-performance-issue-fix-04-connections-lan-settings

Uncheck ‘Automatically detect settings’

cameron-dwyer-sharepoint-webdav-open-explorer-performance-issue-fix-05-automatically-detect-settings

That’s it. After making this change I could go back to SharePoint and the SharePoint Library ‘Open in Explorer’ action was 4x faster than it had been. I was also getting much faster opening times of my non-Office files.

How to fix issue with opening Visual Studio solution from tfspreview.com by moving it to visualstudio.com

This problem arises if you were using Team Foundation Services (TFS) Online while it was still in preview. You will be accessing TFS on a URL such as: https://mycompany.tfspreview.com A recent change has been made to TFS Online that prevents you opening solutions using this URL. When you try to open an existing solution (that you have already synced down to your development machine ) you will see the following error message in Visual Studio:

image

Attempting to “Go Online” with the solution, or disconnect from TFS and reconnect using the same tfspreview.com address will result in a security credentials prompt that accepts your credentials but just sits there blank. BTW trying to login to the tfspreview.com URL in IE also results in this blank page behavior, in Chrome it gives a slightly better redirect error.

image

What Microsoft want you to use instead is the visualstudio.com address instead: https://mycompany.visualstudio.com.

This is simple if you just want to access TFS in a browser. Simply use the new address, but how do you get Visual Studio to start using the new URL to connect for a solution you already have on your dev machine?

Here’s the process that’s worked for me across Visual Studio 2012 and 2010.

Remove the existing TFS Connection from The Team Explorer

image

 

Now Add a TFS Connection using the visualstudio.com URL

image

 

Open the TFS Source Control Explorer now you are connected using the new visualstudio.com address

image

 

Select the solution folder for the solution you have synced to the local workspace on your development machine. Right click the solution folder and select the Get Specific Version… option from the context menu.

image

 

Ensure you check the option to “Overwrite all files even if the local version matches the specified version”. This will effectively pull all files for the solution from TFS again even if there has been no change made to the files. This has the side effect of fixing the binding of the files so that after the sync the files will now be bound to visualstudio.com instead of tfspreview.com.

image

 

Once the sync has completed you should see the following message:

image

 

Click Yes, and you will get a dialog letting you know of any offline changes.

image

 

That should be job done. Your Solution Explorer should now show the TFS icons indicating the source control state of all the files and you’ve now left the tfspreview.com URL behind.

Other links referencing this issue:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/4c887b08-60fe-40fb-8e25-81ab4c267003/cant-connect-to-tfspreview-in-vs11-but-can-via-ie?forum=TFService

 

%d bloggers like this: