Visual Studio: class wizard malfunctioning - visual-studio

Several class wizard functions aren't working, most of which I don't need very badly, but not being able to add classes to MFC controls is a big problem. I have an MFC dialog project going on, and whenever I try to, say, add a function to a class I just get "The operation could not be completed"--not very helpful. If in the resource view I right-click on a dialog and select "Add Class..." nothing happens.
I have Microsoft Visual Studio 2005 w/SP1. I'm running WinXPHESP3 32-bit.
BTW, this project was imported from VS 6.0, so I've got a bunch of things lying around like AFX_MSG_MAP, which I'm starting to suspect is useless and maybe interfering.

Like I mentioned in comments, a repair didn't work, so I did a reinstall. That also had a few errors, but VS seems to work now. If I had to do it all over again, I might have tried reinstalling the SP1 first.

Related

How do I rebuild an empty Visual Studio 2017 toolbox - WInForms

I am hoping someone can provide a little insight.
I am working with a Visual Basis WinForms application using Visual Studio 2017 on Windows 10.
I had a Toolbox with several custom objects.
While testing the application, VS completely froze. With no other alternate approach presented itself, I decided to abort VS via Task Manager.
When I restarted VS, I discovered that the Toolbox was empty. Not just my custom objects; in fact, all the standard objects were gone as well. When I clicked "Show Objects", I saw both the standard objects as well as my custom ones listed, but they were completely disabled (grayed out) and not selectable.
I researched several tickets regarding similar issues on StackOverflow and tried all the following approaches, without any success:
Clicked Reset Toolbox, deleted the toolbox ".tbd" files and
restarted VS.
Reinstalled, upgraded and restarted VS.
Changed the Project Type from Windows Application to Class Library and then
back again.
Restarted VS ("devenv.exe /ResetSettings", "devenv.exe /SafeMode")
If I create a brand new Windows Application, the toolbox builds in the correct items.
How do I get the toolbox to build correctly for my current solution/application? I do not want to have to create a brand new application as the application is an established and very large one, and rebuilding is not an option.
Any insights and/or suggestions would, of course, be greatly appreciated.
Thanks in advance,
Chris Fleetwood
cfleetwood#smartstart.org

What's the reason for error message? I am using VS 2010 professional edition

What's the reason for error message "The snapshot is out of date and cannot be used anymore because type tree has been updated, A new snapshow needs to be acquired"?
This error appeared right after I launched VS2010 and added username/pwd to connect to TFS repository.
I am using VS 2010 professional edition.
It happened to me with VS2012 as well after loading the project without source control binding, a local simple WinForms project. All I needed to do was Clean & Rebuild. After that the problem was solved.
This is a bug in Visual Studio. According to http://connect.microsoft.com/VisualStudio/feedback/details/742959/the-snapshot-is-out-of-date "We've taken a closer look at this problem and it isn't one that we'll be able to solve in the next release of Visual Studio."
They recommend waiting around until the background language parser service is done (or, in other words, don't try to be too productive there partner.) My experience is that closing all documents, cleaning the solution, rebuilding it and then closing and re-opening with a pause after does remove the error.
Until you do something silly, like edit code. Then all bets are off again as to when it reoccurs.
I had a similar issue with VS2012 and after rebuilding the solution twice, I still saw the same error message.
Following an advice from a post from this site, I closed the Designer tab, reopened it from the Solution Explorer, and the problem was resolved.
I got this error too, but after I unload project and reload project, the problem was resolved.
Simply restarting Visual Studio 2012 was a workaround for me, but it kept happening about every hour and having to restart visual studio that often was very annoying.
I also found this post which suggests that the Productivity Power Tools are the problem and to simply turn off the Automatic Brace Completion in Tools->Options->Productivity Power Tools. Since making this change I haven't seen the error message again :)
I'll note though that I am using Visual Studio 2012 and the OP is using Visual Studio 2010, but the Productivity Power Tools are available for VS 2010 too, so this may still fix the problem in VS 2010.
The same issue persists in VS2013, but no amount of Clean/Rebuild or restarting VS will help. The only way I can do a successful publish, is to disable the AutoT4MVC extension.
I got this error too. I closed Visual Studio 2012 and opened it again and the error was gone.
I got this error when I had conflicting class names / namespaces. I was referencing a UserControl from a different DLL in my XAML file which had the same name as my XAML file (class name). Maybe this helps.
I used Visual Studio 2012, and just faced this error on my Windows 8. It seems like Turning off the VM and restarting Visual Studio fixed the issue.
I just got this with VS2010.
I had a form with a user control (UCa) with a user control (UCa) from a different project on it. Made a change to the UCb then flicked to the designer for the form and boom! Snapshot error.
Resolved by a full clean and then rebuilding just the UCb project before building the rest of the project.
I'm using Visual Studio 2012, and I got this error when starting Visual Studio, letting TFS connect to the server, and THEN opening my solution. The fix was simply closing VS and launching the solution directly.
I'll throw my two cents in here as well.
I've tried every combination of Clean, Rebuild, Restart, etc. What I've found is that restarting Visual Studio usually makes the problem go away for at least one Publish. Here's the weird part, though. You can also fix the problem by doing absolutely nothing. If you just let Visual Studio sit for about a minute or two, and then publish, it will usually work just fine. There's some background voodoo going on here, and waiting for it to finish seems to do the trick.
I have a solution with two parts that need published. One is a WCF service application, and the other is the ASP.NET MVC5 website itself. Anytime I publish the services, and then try to publish the site I'll see this error. I can publish the services, restart VS, and then publish the site, OR I can publish the services, go get a drink, and then publish the site. As long as I give VS a chance to "settle" between any kind of rebuild and the publishing of the site, everything seems to work as expected.
Take a walk, come back, problem solved. OR if you don't have the time. Clean, Rebuild, Restart, Publish (lather, rinse, repeat).

Visual Studio text editor does not recognize F# source?

I have got the following problem with F# code recently: almost the complete code is underlines with curly red lines (indicating problems) and whenever I hover with the mouse cursor over any word the pop-up appears with the message "Unexpected token". IntelliSence doesn't work either.
Nonetheless if I start the project it is executed without any problem.
This happens both to already existing F# files and to newly created F# projects. I remember it was working just 2-3 months ago!
I tried to deactivate all possible extensions but it doesn't help.
Any ideas?
I get this too. Sometimes, simply exiting and going back into VS helps. When I tweeted the problem, Don answered with this:
"do you have "python tools for visual studio alpha" installed? if so, uninstall it or apply the hot fix"
This wasn't relevant to me (as I haven't been anywhere near python) but I'm posting here in case it helps you.
-- Edit: here's a link to the patch, thanks to Alexander Galkin: http://pytools.codeplex.com/workitem/599
I haven't seen this situation before but here's a guess at why it's happening and how you might cure it.
Visual studio works on a system for plugins. Even the stuff that is "native", like the C#/F#/VB.NET project systems, are just plugins that uses the visual studio shell. It looks like the F# plugin has been damaged in someway.
If this is Visual Studio 2010:
You might try opening the visual studio installer and trying a repair installation or deactivation and reactivating the F# project system
If this is Visual Studio 2008:
You might try uninstalling and reinstalling the F# plugin

Phantom Context menu items in Visual Studio 2010

I am having an issue with my context menu in Visual Studio 2010 that is driving me nuts. I think it started when I installed the Code Snippet Designer Extent ion but I am not 100% sure about that. I didn't notice it until after I uninstalled that extension with a few others.
I have tried reinstalling and then uninstalling the extension again but that didn't work either. I am left with these extensions on my machine DevExpress Tools, Dpack, PowerCommands for VS, Productivity Power Tools and the VS10x Code Marker.
I have another system that has all the same extensions installed but doesn't have the context menu problem and I never loaded the Snippet Designer on that machine, which is why I think the problem was caused by something in that particular extension.
Here is what it looks like.
http://www.mydatafish.com/contextmenu.png I tried to post a picture but I need more points to do so and it is hard to explain without a picture so please take a look at the link.
Anybody have any ideas of how I can remove these phantom mene items? By the way I did try resetting the context mene through the the customize menu item in the Tools menu.
OK I am not sure how it got in the condition that it was but I found the program that was causing the problem. It was something called "Code Helper" and it was an add it that I used with VS 2005. It was listed as a AddIn for Visual Studio 2010 but wasn't inside the Addin directory for 2010.
To get rid of the problem I removed the program from the Programs and Features (Add/Remove).

VS2010 express beta2 - no add reference dialog, no open file/project dialogs

Just installed VS2010 express for Windows Phone last night. Install went smoothly. It creates a project, compiles, and deploys the app to the emulator.
Here's the problem: When I try to "Add Reference" through the Project menu, I do not get the Add Reference dialog box. Same thing if I right click References in the solution explorer and click Add Reference. That's not all. "File...Open" and "File...Open Project" also fail to throw up an open file dialog box. When attempting any of these actions, the IDE quickly loses and regains focus. Even pressing a keyboard shortcut (Ctrl+O) causes the IDE to quickly lose and regain focus, but no open file dialog box appears.
This is what I have tried, not particularly in this order:
1. Turned off UAC
2. Monitored file and registry access using Process Monitor during a File...Open operation. File activity showed mostly "SUCCESS" with a few "FAST IO DISALLOWED" and a few "INVALID DEVICE REQUEST" results. Registry activity showed mostly "SUCCESS" with some "NAME NOT FOUND" and a few "BUFFER OVERFLOW" results.
3. Created a new, clean Windows account to run the IDE from
4. Forced a test project to add a reference to "System.Xml.Linq" by editing the ".csproj" project file. Project failed to load in the IDE.
I don't have these problems at all on 2 other Windows 7 computers with VS2010 C# express beta 2 installed. One machine is 32bit and the other 64bit, both Home Premium edition.
My system: Windows 7 Home Premium, 64bit
Other Visual Studio products installed: VS2008 C# express, VS2008 C++ express
One other thing to note: Several months ago I installed the non-phone distribution of VS2010 C# express beta 2, and I had the same exact problems. Back then I chalked it up to being beta and went back to VS2008 C# express, where I do not have these issues.
Matt, if you're still reading this post, I have a solution:
Do you have the Tablet PC Input Service disabled? Enable and start it. This was suggested to me over on the MSDN forums, and it worked for me immediately. I have this service disabled, but I turned it on, fired up VS2010, and it just worked right off. I confirmed this solution by turning the service off again, starting VS2010, and noting that it breaks once again. Turned the service on once more, started VS2010, and it works perfectly. Amazing.
I do not think it's acceptable to require this particular service just for VS2010 to function correctly. Hopefully they fix this in the inevitable service pack. FYI, I had this service disabled because I turn off all services I don't require. So now I have two "wisptis.exe" tasks eating up ~8MB of RAM and starting every time I turn on the PC. Or I can shut the service off again and just resort to my previous workaround. haha
Here is a work around.
Just run wisptis.exe from command line and start the visual studio.
If you don't wanna run each and every time you restarts the computer,then just put wisptis.exe in a .bat file and move it to the startup folder,so that it will be automatically executed on each and every startup.
EDIT 1 :- Or else just press 'WIN'+'R' and type 'wisptis' and press 'Enter'.
I experienced the exact same problem. I'm running VS2010 Express on Windows 7 (x64). Re-enabling the "Tablet Input" service "fixed" the problem.
VS2010 has always worked fine, and then suddenly for no apparent reason "ctrl-O", "Add Reference", "Open Project", and other similar functions stop working.
No amount of repair/uninstall/reinstall would fix the problem.
I always disable the "Tablet Input" service on Win 7, because I use a Wacom tablet, and dislike the visual notification of (tablet) mouse clicks this service causes. VS2010 has so far been working fine in this setup with Tablet input service disabled, but then suddenly the problem arose, and I had to re-enable the "Tablet Input" service to make it go away.
I have another computer with the exact same setup - Win 7 (x64), VS2010 Express, Wacom table, and disabled "Tablet Input" service - and here VS2010 is still working just fine. Both computers also have almost identical software installed and updates installed, so I still have no idea where the difference lies.
Has anyone had more luck in finding the root cause?
I also use Power Toys, but I have not been able to correlate this installation with the problematic behavior of VS2010.
I'm having close to the same issue with the exception that my New | Project dialog works, but Add Reference and Ctrl + O just cause the interface to lose focus and regain focus without every launching the dialog. I have tried running devenv /ResetAddin and devenv /ResetSkipPkgs, but neither helped. I have UAC turned off as well. I don't experience the issue with VS2008.
Here's my setup:
Windows 7 Ultimate x64
Visual Studio 2010 Ultimate RTM
Visual Studio 2008 Team System Developer Edition with Team Explorer 2008 and VS2008 SP1
The only addins I run:
GhostDoc
.NET Reflector
Other Related Products I run:
Microsoft Expression Studio 3
SQL Server 2008 Developer Edition with SP1
tonight I uninstalled the VS2010 Express beta 2+phone tools and installed the now final RTM VS2010 Express C#. It STILL had the problem! For kicks, I tried importing a VS2008 project because it has some extra references in the project, and I was curious how they would be handled. The project imported successfully, but compiled with errors that it couldn't find a reference for a SyndicationFeed object, even though the reference for it was successfully added to the References list upon import. I remove the reference (System.ServiceModel.Web), hold my breath, and try to Add Reference one more time. Amazingly, the Add Reference dialog pops up, I add the reference back, recompile and bingo. File...Open and File...Open Project now throw up the proper file open dialogs as well.
To be sure this isn't a fluke only related to importing an old project, I shut down VS2010, start it back up, create a brand new project and try Add Reference. It works still. The File/Project dialogs also show up. I have no idea how, but importing a VS2008 project apparently made VS2010 correct itself on my machine.
Thank you for replying to my post. After hours of Googling over the past few days, your post is the first I've seen of anyone else having this issue besides me.
I found a workaround, but it's annoying having to do this:
1. Create a new project
2. Close VS2010, don't bother saving the new project
3. Start VS2010 again, and everything works as it should. I can access the Add Reference dialog, and I can do a File...Open and Open Project from the menu and toolbar.
If I close VS2010 and start it again, it is broken once more. Performing my workaround fixes it again for that session.
Still looking for a permanent solution.
I finally figured out a work-around. If I temporarily disable the Power Tools, the original Add References dialog opens fine. After adding my references, I can enable the Power Tools again.

Resources