the service microsoft.visualstudio.shell.interop.iselectioncontainer already exists in the service container in VS2022

Sunny Sharma 1 Reputation point
2023-03-24T14:39:48.4166667+00:00

I recently installed Visual Studio 2022 Professional edition on my machine windows 2010. I'm just trying to create a sample windows form project and trying to open the designer / form by double clicking on Form1.cs and I'm getting this weird error message:

"the service microsoft.visualstudio.shell.interop.iselectioncontainer already exists in the service container"

I have even tried uninstalling and reinstalling VS 2022 number of times but no use.

It would be really great if someone can help me out in fixing this.

Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2023-03-24T15:14:28.5366667+00:00

    There is no Windows 2010. Do you mean you're running on Windows 10?

    The error does seem to indicate a bad install. But this has been an issue for years. The problem generally stems from too many entries in the GAC for System.Design. Some people say compiling the code first solves the issue while others says to delete the .vs hidden folder in the project. These seem circumstantial to me.

    Someone from MS said to run gacutil /l System.Design. You should get 1 entry for .NET 2.0 and one entry for .NET 4.0, both targeting MSIL. If you get any extra entries then they will cause an issue. Remove them from the GAC using gacutil /u <fullassemblyname>. Ensure you use the full name which includes the version and platform. If that doesn't work then go to the GAC on your machine and remove the file manually. Be sure you are not in the GAC_MSIL folder as these versions you want to keep.


  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-03-24T15:40:26.8266667+00:00

    windows 2010 is not a supported platform.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.