the service microsoft.visualstudio.shell.interop.iselectioncontainer already exists in the service container - visual-studio

I recently installed Visual Studio 2013 Ultimate version on my machine. 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"
My system is already having Visual Studio 2010 which is working smoothly from a long time. I then installed Visual Studio 2012 which was giving the same problem as above. So I went ahead with installing VS 2013 hoping that I might be able to get rid of this issue, but no use.
Once I click OK on the error windows, I can see the following "message" in the bottom Error List window:
"The file 'C:\Users\ABCD\Documents\Visual Studio 2013\Projects\WebSite1\WindowsFormsApplication1\Form1.cs' does not support code parsing or generation because it is not contained within a project that supports code."
I have spent 2-3 days searching various blogs like these, all of which talk about previous version of Visual Studio like VS 2005 / VS 2008:
https://connect.microsoft.com/VisualStudio/feedback/details/311949/the-service-microsoft-visualstudio-shell-interop-iselectioncontainer-already-exists-in-the-service-container
Form inheritance in Visual Studio 2008 doesn't work
I have even tried uninstalling and reinstalling VS 2013, again no use.
It would be really great if someone can help me out in fixing this.

I've just had the exact same error message.
After compiling the solution(F6 or Build->Build Solution) it worked fine for me.

To deal with your issue, please first make sure that you installed latest updates on your Windows 8 machine, and then repair VS2013.
During your repairing process, please temporally turn off your anti-virus/antispyware software and repair VS2013 with the Administrator privilege.
follow this link

The problem got resolved finally, after so many days and various frustrating tries to resolve the issue. I should thank Tim Atkins from Microsoft for helping me with resolving this issue.
Fix: When we tried 'gacutil /l system.design', we found that there were 3 variants of system.design; One from .Net 2.0 targetting MSIL, second from .Net 4.0 targetting x86 and last one also from .Net 4.0, but targetting MSIL.
On a working machine, there were only 2 entries, the .Net 4.0 one targetting x86 wasn't there. Hence we uninstalled this version using gacutil which did the magic. I was so relieved seeing the win forms popping up without any errors anymore :)

I changed the target framework from 4.5 to 4.6.1 and it fixed it for me. My assumption is sometimes when you change target framework back and forth and the process does not go through all the way (cancelling in the middle of changing it) - something happens that leads to this error. Hope that helps

I solved this be closing VS, deleting contents of the .vs folder where my solution is, restarting VS and recompiling.
Seems like one of those file/settings/caching problems that pop up now and then, might be after switching source branch.
VS2019, .net fw 4.6.2.

If your C drive (Where you are installing Visual Studio) does not have enough space, try moving some files from the C drive to another drives.

Related

Target Framework not installed when opening a Unity project with Visual Studio 2022

I am trying to open a C# solution that has been generated from a Unity v2020.3.19f project with Visual Studio 2022. Opening it with Visual Studio 2019 works just fine, but there are reasons I'd like to be able to open it with v2022 (such as GitHub Copilot). I did not have issues with this on my previous install of Windows 10.
Upon opening the solution in VS2022, I get the following pop-up prompt for every project in the solution:
Choosing the first option updates the target project to .NET Framework 4.8 and loads the project, but the whole file appears with red lines. When hovering over an underlined bool Property, the error shows as: `CS0518: Predefined type 'System.Boolean' is not defined or imported.
Choosing the second option opens this URL in my browser, prompting me to install .NET Framework 4.7.1 targeting pack (which was already installed via the Visual Studio Installer). When I try to install the .NET Framework 4.7.1 runtime, the installer responds with .NET Framework 4.7.1 or a later update is already installed on this computer. When I try to install the .NET Framework 4.7.1 Developer Pack, the installer allows me to choose from "Repair", "Uninstall", or "Cancel". Repairing has no effect.
I installed both versions of Visual Studio (2019 & 2022) the usual way through the Visual Studio Installer, along with the "Game Development with Unity" workload, which tells me it's installed all dependencies just fine:
Here's what I've tried so far:
Uninstall & reinstall all versions of Visual Studio through the Visual Studio Installer
Uninstall & reinstall Unity, with the Visual Studio module installed through Unity Hub (which just opens the Visual Studio Installer for me to choose which version I want to install)
Regenerate project files through the Unity Editor
Uninstall any references to .NET Framework through the Control Panel
Try reinstalling .NET Framework targeting pack 4.7.1 either from the Visual Studio Installer or manually through the Microsoft SDK website from the prompt
Nothing works for me. Any help on how to make VS2022 stop complaining is greatly appreciated.
Update 1: I found a couple of threads where people suggested simply pressing the Regenerate project files button in "Edit -> Preferences -> External Tools`. This has not helped me.
Update 2: I've tried everything I can possibly imagine, in different orders and different combinations. I even reinstalled Windows 10 to no avail. It's like Visual Studio just doesn't want to accept that the .NET Framework 4.7.1 targeting pack is installed. Please help :(
check this
https://learn.microsoft.com/en-us/answers/questions/733018/visual-studio-2022-cannot-locate-installed-net-fra.html
If you modified the value of ProgramFilesDir(x86), just to modify it back to C:\ProgramFiles(x86) can solve the problem
That is a very interesting problem, my main solution for you to first try is to make sure you are even targeting the correct .net framework in UNITY before you even build the solution. You are using the .NET 4.x, you need to go into your configuration settings and player settings in unity and ensure its not on a different version, for me, unity still defaults to .net standard 2.0. Follow the steps located here. To do so.
Another solution is to see if that first option actually gives you errors that prevent you from using unity, because I know that Visual Studio Code has problems occasionally where it tells me im wrong, my program is wrong, every life choice I have made was poor and I am poor, yet in unity, there are no errors showing in the console and I can hit play no problem. In that case I just had to rebuild a few times and fiddle with vs code until omnisharp stopped yelling at me.
Apperently I have been in a similar situation as when you were getting the error "Predefined type 'System.Object' is not defined or imported" because looking into it, I already have clicked on some of the links, try this one if that error persists. If you cannot prevent the errors to begin with, I would recommend you trying to fix the upgraded version from option one as that is more than likely going to get you the closest to a solution.

Microsoft Visual C++ 2010 Express project creation failed

Before I begin, I would like to note that I am running Windows XP SP3.
Recently, I noticed that my installation of MS Visual C++ 2008 Express would no longer create new projects, only open previously created ones. Please note that it has been able to create projects in weeks prior.
Rather than trying to find a solution for the 2008 version, I took the opportunity to upgrade to MS Visual C++ 2010 Express. After downloading and installing it, I encountered the same problem, only this time (will not create new projects), I noticed a message near the bottom of the window that read "Creating project '[project]'... project creation failed". I then uninstalled both versions (2010 and 2008), rebooted, reinstalled 2010, and... same problem.
I then followed this tutorial, where I (re)registered VsWizard.dll, then modified the owners of HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VsWizard.VsWizardEngine.10.0 and HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VsWizard.WizCombo.9.0 to Administrators, and gave all users Full Control/Read permissions. This seems to be the solution that a number of other websites suggest, but it still did not help.
Thus, I am at a loss of where to go next. I, unfortunately, have no Restore Point to fall back on, so I need a different solution, if possible. Any help would be greatly appreciated.
I had a lot of issues and frustration with solving this "issue", nothing worked.
I changed my default ProgramFiles directory to my D drive as my C drive runs a SSD. By monitoring the visual studio process, I discovered that it was looking for MSBuild / Microsoft.Cpp on my D drive (not on my C drive, where my operating system is located). This was what caused the issue.

Visual Studio 2010 crashes repeatedly

I've been running Visual Studio 2010 (the official release) for some time now. Lately, VS will crash 10+ times during my 8 hour work day. In VS2008, crashes were common when working with large Xaml files, and while I experience some of that with VS2010, crashes occur when debugging, starting the debugger, stopping the debugger, and other random times when editing code.
I've looked through the problem reports, and the one I've found that occurs most frequently is:
Description
Faulting Application Path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Problem signature
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba1fab3
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000005
Exception Offset: 0002e23e
I'm running Windows 7 (x64). Hoepfully someone has come across this problem and has found a solution. I plan on reinstalling VS2010. Hopefully that takes care of the problem.
Do you think you have installed any extra Extensions which might lead to frequent crashes?
You can try
Devenv.exe /SafeMode
to start in Safe mode. You can also try
Devenv.exe /Log
Which will log all activity. Have not tried this so don't know What activities are logged.
Visual Studio 2010 Command Line Switches
I was having a similar problem and this helped me
http://connect.microsoft.com/VisualStudio/feedback/details/618802/visual-studio-random-frequent-crash
Running this from the command prompt seemed to fix it. It hasn't crashed for the whole day today.
regsvr32 c:\Windows\System32\ole32.dll
I had similar issues with Visual Studio. The problem was the service pack which for some reason was not installed properly.
I had to reapply the SP1 using the Repair / reapply option. This kind of fixed my issue.
Also make sure to reboot the system.
Just to help people who search it: It was webex instant messenger related part, but not Cisco itself. The cause was a component in Studio Power Tools relevant to integration with messenger. Reinstall power tools but without messaging integration.
In other occasion it is almost always a corporate antivirus authentication helper thing. It required to manually remove registry entries which cause background TFS logins break the studio at random moments.
I had the "Microsoft Visual Studio 2010 has stopped working" error, imediately when Visual Studio 2010 was starting. Fault module was clr.dll in my case. Only rebooting helped sometimes.
I solved it by removing .NET completely and reinstalling it.
Be aware that if you updated to .NET 4.5 this includes .NET 4, so you have to remove and reinstall .NET 4.5
I know why it could be crashing. Code it self. Have you tried to debug the failed instance of VS2010 with Vs2010? If the xaml designer crashed anywhere in your code you should be able to see the stack trace. Also, try to load the same xaml into Blend 4 and then run the vs2010 on Blend when that crashes. I've had some good results debugging Vs2010 crashes like that.
There are so many things that can cause studio to crash.
I'd look at everything from video card drivers to whether the RAM is stable.
Note, there is a microsoft connect but on this exact issue at: http://connect.microsoft.com/VisualStudio/feedback/details/634162/devenv-exe-frequent-intermittent-crashes-fault-module-name-ntdll-dll
You might vote on it or add your own information to the report but the very first thing I'd do is update my video drivers. One place I was at had a lot of issues with 2005; it would randomly crash just displaying the design surface or when opening a few too many code files; but once we got decent video cards and the appropriate drivers installed it worked flawlessly.
I disabled “Options"-"Evnironment"-"Add-in/Micros Security"->"Allow macros to run", and fixed the problem.
I think I just solved a similar issue on my computer, but probably not the same cause. It was related to TortoiseSVN (I think visual loads the tortoise DLL because it is integrated with the explorer, even if I don't have a specific visual studio plug-in). I upgraded TortoiseSVN (from 1.7.8 to 1.7.11) and it didn't crash for a few hours (I also had a 100% repro case when closing visual studio which does not happen anymore). Maybe there is some way to check what DLLs are loaded by visual studio to troubleshoot what are the candidates for upgrading/uninstalling, but I didn't go this far.
Hope it can help someone else.
While developing C++ code, Visual Studio 2010 started crashing frequently and at random times after I enabled the Task List.
As an alternative to using the Task List, I am now simply using the Find in Files tool (Ctrl+Shift+F) and searching for the string TODO as an alternative.
i was having a similar problem. visual studio 2010 was crashing. when i attached, it said it had a read access violation in ntdll.dll
closed all my open instances (there were 5) and it stopped happening.
Today I had this error, in my case it was because Microsoft released the update (KB2858725) the FrameWork 4.5.1, which the download and installed,
However this is definitely addressed by performing the following steps:
FrameWork 4.5.1 download (KB2858728) => NDP451-KB2858728-x86-x64-ENU.exe-Allos
http://www.microsoft.com/en-us/download/details.aspx?id=40779
Install the downloaded software (KB2858728)
Try Vs, but give the same error.
Uninstall the downloaded software (KB2858728)
(this task fully cleaned upgrade giving problems (KB2858725)
Install the downloaded software (KB2858728) again
Try Vs, this time if it will work
NOTE: NEVER! install update (KB2858725)
Logging helps indeed. I have the same problem with crashes. Since there could be numerous reasons and lots of log data, I wrote this .bat (Win7 x64, VS2010 Express) to keep logs organized and easy to analyze:
#echo off
rem date and time in format YYYYMonDD_hhmmss
set year=%DATE:~-4%
set month=%DATE:~3,2%
set day=%DATE:~0,2%
IF %month%==01 set monthstr=Jan
IF %month%==02 set monthstr=Feb
IF %month%==03 set monthstr=Mar
IF %month%==04 set monthstr=Apr
IF %month%==05 set monthstr=May
IF %month%==06 set monthstr=Jun
IF %month%==07 set monthstr=Jul
IF %month%==08 set monthstr=Aug
IF %month%==09 set monthstr=Sep
IF %month%==10 set monthstr=Oct
IF %month%==11 set monthstr=Nov
IF %month%==12 set monthstr=Dec
set now=%TIME:~0,-3%
set now=%now::=%
set now=%now: =0%
set now=%year%%monthstr%%day%_%now%
start "VS2010 express" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" /Log "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSlogs\VS_log_%now%.txt"
I had the same problem. I cleared my settings. Configured environment to use C# development settings. Then i disabled all extensions against which disable button was present. I enabled them one by one while opening, running and closing solutions. I found the offending extension to be .Net reflector v 8.5.0.179 by red gate. I had VS2010, VS2012 and VS2013 all installed on my windows 8.1 enterprise 64bit. All of them had the same issue. Whenever i closed the solution VS would crash. Hope it helps.

Error: The project type is not supported by this installation

I'm trying to open a silverlight project in Visual Studio 2008 and getting this error.
The project type is not supported by this installation.
Let me tell you I did installed:
VS2008
SP1
Silverlight Tools 3
Silverlight SDK
Silverlight
And they were installed in the sequence they are mentioned here. Still I'm getting the same error.
Adding some more details which might be helpful in identifying the cause:
When I try to create a new silverlight project it gives me error "Object reference not set to an instance of an object". And shows "...project creation failed."
I tried unistalling all of the things and installing them again. It really took a lot of time but didn't solved my problem.
Any help appreciated.
Open the project.csproj file with another editor, delete whatever you find between
<ProjectTypeGuids></ProjectTypeGuids>
I've had the same error when I tried to open a solution which required VB.NET, despite everything (to my knowledge) being C#.
If you've done a full install of VS then try this solution: http://andrewgunn.blogspot.com/2008/03/silverlight-project-type-is-not.html
Let us know how it goes.
Do you know who the silverlight project was created by? If so, then contact them and ask them if they used VS 2008 or if they used VS 2010 beta 1/2 (VS 2010 has a lot more and better support for silverlight so it's probable)
If they used VS 2010, then just go to the microsoft website and download you a copy... it's free(right now)
(and if you'll be doing much silverlight development, I'd recommend downloading it anyway. It has code completion for XAML!)
run devenv /setup

Visual Studio setup problem - 'A problem has been encountered while loading the setup components. Canceling setup.'

I've had a serious issue with my Visual Studio 2008 setup. I receive the ever-so-useful error 'A problem has been encountered while loading the setup components. Canceling setup.' whenever I try to uninstall, reinstall or repair Visual Studio 2008 (team system version). If I can't resolve this issue I have no choice but to completely wipe my computer and start again which will take all day long! I've recently received very strange errors when trying to build projects regarding components running out of memory (despite having ~2gb physical memory free at the time) which has rendered my current VS install useless.
Note I installed VS2005 shell version using the vs_setup.msi file in the SQL Server folder after I had installed VS2008, in order to gain access to the SQL Server 2005 Reporting Services designer in Business Intelligence Development Studio (this is inexplicably unavailable in VS2008).
Does anyone have any solutions to this problem?
P.S.: I know this isn't directly related to programming, however I feel this is appropriate to SO as it is directly related to my ability to program at all!
Note: A colleague found a solution to this problem, hopefully this should help others with this problem.
A colleague found this MS auto-uninstall tool which has successfully uninstalled VS2008 for me and saved me hours of work!!
Hopefully this might be useful to others. Doesn't speak highly of MS's faith in their usual VS maintenance tools that they have to provide this as well!
I had the same error message. For me it was happening because I was trying to run the installer from the DVD rather than running the installer from Add/Remove programs.
In my case, uninstalling from Add&Remove Programs didn't work. Instead, the problem was due to a recently hotfix installed through automatic updates. The hotfix to VS 2008 (in my case) has the number KB952241, so I uninstalled it using Add/Remove Programs checking on the show updates option. After it was unistalled the problem was gone.
I encountered the same problem and found a very easy solution.Go to the following Link:
http://msdn.microsoft.com/en-us/vs2008/bb968856.aspx
and run VS AutoUninstall tool .This will automatically remove all the components of VS 2008.
Cheers
Sure enough, for me, it was the hotfixes. In Add/Remove Programs, check the "Show Updates" box, and remove ALL of the Hotfixes associated with your version of VS2008. Then try the "Change/Remove" button - it should now proceed without a hitch.
Well, it did for me, anyway... ;-)
I have Visual Studio Team System 2008 Development Edition, and had to remove all updates and Hotfixes:
Update KB972221
Hotfix KB973674
Hotfix KB971091
Reboot, then the following Hotfix appeared, which I then removed as per #riaraos' answer:
Hotfix KB952241
Before the Change/Remove would work!
Hope that helps someone else.
Uninstall hotfixes installed in related to vs2008 and then try again.
It worked for me and hopefully it will for you as well.
Thanks,
Zelalem
Remove the following hot fixes and updates
Update KB972221
Hotfix KB973674
Hotfix KB971091
Restart the PC and try to uninstall now. This worked for me without problems.
Microsoft itself posted a KB article about this, and that article has a service pack that they claim fixes the problem. See below.
http://support.microsoft.com/kb/959417/
It took a while for the associated update to install itself, but once it did, I was able to run the Visual Studio setup successfully from the Add/Remove Programs control panel.
You should look for the MSI setup logs in the temp directory of your system. They will contain detailed inforamtion about why the setup failed.
I had a similar installation problem with Visual Studio 2008 which I was able to resolve by studying the logs.
I think this sort of question is entirely appropriate to the forum, especially if an easy solution can be found, as would save others hours of pain.
Unfortunately I dont have the solution, but would suggest (if you haven't already)
Run FileMon to see if the
installer is looking for specific
files which are no longer there -
this may give some clues.
Painful, but try uninstalling other apps based upon the VS shell (eg 2005) first.
Thanks, riaraos, uninstalling KB952241 was the solution for me, too. Before doing that I tried to run the installer from "Programs and Features" and from the installation DVD without success. I did not want to completely remove the VS 2008 installation but only add a few components.
Notes on my system:
Windows 7 Beta 1
Visual Studio 2008 SP1
Okay I had the same issues first my VS2008 was acting up so i tried to uninstall it and it didn't work...I read online that using an AutoUninstall by MS will do the trick it did just that , but left a lot of nasty files behind..
So i used "Windows Install Clean Up" and cleaned up more stuff that had to do with VS..
then went back into Add and remove in control panel Removed the KB952241...
then opened up Ccleaner and scanned the registry found a lot of left behind crap from VB2008 removed all that once that was done.
I went ahead and launch the installed back from the CD again and BAM its working.
I did all this without having to restart my PC..
Hope this helps people who are stuck..like i was
In my case, installing visual studio SP1 unbroke the uninstall/repair functionality.
Windows 7 suggested to "Uninstall using recommended settings" after hitting OK in the error message. It solved the problem.
Solution to this is
http://www.dotnetzone.gr/cs/forums/48758/ShowThread.aspx#48758

Resources