Visual Studio 2008 Designer File Bug? - visual-studio

This has been driving me crazy for months. I have a multiple projects that compile without errors. If I start copying and pasting controls (or even just plain 'p' tags) the designer will fail 1/2 the time with the error "the method or operation is not implemented". The complexity of the page doesn't matter. The 'solution' is to delete the designer file, exit visual studio, open visual studio and convert the offending aspx file to a 'web application' to regenerate the designer file.
This is a really annoying. I can't find any fixes on Google. Is there a way to disable the automatic designer file? Make it so it only generates on a 'build' command and not fail everytime I'm laying out a aspx page?
Thanks

To find the fix for the issue you would need to find the cause of the issue. It might be possible to get more information on what is causing the issue if you attach a debugger to Visual Studio. This could be done by following these steps:
Open two instances of visual studio (run as administrator)
In one, open your project and get to a point right before the issue occurs
Attach the other instance of Visual Studio to the one with your project (Tools -> Attach to Process)
Perform the steps to reproduce the issue.
Note that to actually catch the exception you will need to change a few debugging options. First you would need to make sure that the Just My Code check box is unchecked in the General debugging options in Visual Studio. The second is on the exceptions dialog you will need to catch thrown exceptions. The exception dialog is under the Debug menu in Visual Studio.

Related

VS2013 Build "Does not support previewing"

Every time I try to build my solution in VS2013, nothing builds, no errors - But in the status bar it says: "This item does not support previewing"
I googled around a bit but have come up empty.
But if I right click on each project and select build it works fine.
Any ideas?
Perhaps this message is totally unrelated... Post hoc ergo propter hoc
Steps to reproduce on my machine:
Right Click any project in solution: select build
Status bar displays Build successful
Right click solution select build
Status bar displays : "This item does not support previewing"
Perhaps it isnt related, but it sure does appear to be.
I was able to fix this... Somehow nothing was selected to build in the solution configuration. I right clicked on the solution, went to properties and then selected COnfiguration Properties and clicked the Build box for all the projects...
I have no idea how they became unchecked, only thing I can think of is a co-worker was trolling me.....
I've had this problem (i.e. debug not starting, and no error message) with Visual Studio 2015 in the following two cases:
after loading a solution that had previously been built with Visual Studio 2010
and also after using the "save as" function in Visual Studio 2015 to update a solution that had been started with Visual Studio 2010 (using Save as updates the solution file and sets the active Visual Studio version to 14 - i.e. VS 2015).
In both cases, deleting the bin and obj directories under the startup project fixed the problem. It's also worth closing visual studio and making sure that there are no {yourprojectname}.vshost.exe processes still running - if there are then kill them before running visual studio again. On that note, if you have multiple versions of visual studio on your machine, you should also check that you don't have the same solution open in the other version of visual studio at the same time (I've done that one myself).
One of the comments here suggests disabling the "enable visual studio hosted process" option. Don't do that if you can at all avoid it: you'll lose lots of debugging functionality (particularly in the area of being able to edit code while your solution is running).
Hope that helps someone out there.
Solution for VS2015
"this item does not support previewing" vs2015 (Visual Studio 2015/2016)
Step 1. Go to Control Panel -> Programs and Features
Step 2. Uninstall all: Windows Software Development Kit - Windows 10.0.10586.15 (maybe you have diff ver)
Step 3. Download new latest Windows Software Development Kit
https://go.microsoft.com/fwlink/p/?LinkId=619296
Install & Create new project, Done!
Dclick on MainPage.xaml and you will see Loading designer...
1: Add below lines in App.conf
<specFlow>
<unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>
2: add a reference to Microsoft.VisualStudio.QualityTestTools.UnitTestFramework.dll
right click on your project and select: Add Reference
3: add using Microsoft.VisualStudio.TestTools.UnitTesting; in Step Defination
4: goto feature file and run it. This is what solve my problem on vs2013
I faced same issue with .aspx file. I just right click on the .aspx file and select open with (HTML Editor). You can choose any form the list.
I have come across the same issue for me, I have opened a project in VS 2010 and then when I open the same in VS 2015 then his error has occurred.
Solution:
By Closing the VS2010 project solution fixed the issue.

Visual Studio - Error when clicking on Solution -> Properties (Object reference not set to an instance of an object)

When i try to access my solution Properties, i get the following error:
Object reference not set to an instance of an object
I am using VS 2012. What could be the cause of this?
Some extensions may cause this.
Try disabling extensions and restarting Visual Studio.
Quite often error will be gone even if you re-enable extensions after this.
There's a bug report on Microsoft Connect (link).
It is marked there as "Closed as External", but it seems that it may occur randomly with any extension, so would be worth voting it there to bring it to Microsofts attention.
In my case, the problem was solution-specific. NuGet was causing this error, but not the extension itself but a NuGet package that generated an error on VS load. When I opened NuGet Package Manager Console I saw a big red text with a description of the error. In my case it was T4Scaffolding.Core package, which in turn is a dependency of MVCMailer.
If this is your case, you will probably see what package generates an error in PM Console.
I faced this dialog too and i'm not sure what exactly causes this as i couldn't even open the NuGet console to see detailed error messages.
Closing Visual Studio, deleting %AppData%\Microsoft\VisualStudio and restarting Visual Studio worked for me as it causes a reset of various things like window configurations.
I think if this dialog is displayed some files may be corrupt in %AppData%\Microsoft\VisualStudio and by deleting that folder Visual Studio can start normally again.
Update:
The issue arises on my machine when i start Visual Studio by using "run as administator" whereas Visual Studio has been started before without that option and %AppData%\Microsoft\VisualStudio had been created without the administator association.
Visual Studio 2013: I had this issue when I tried opening TOOLS -> Extensions and Updates.
I used #ViRuSTriNiTy idea, but only cleaned the files from:
C:\Users[myUserName]\AppData\Local\Microsoft\VisualStudio\12.0\Extensions
There are 2 cache files over there.
Deleted them and restarted VS2013 and it was fixed
The way it was happening for me might be unique to me/my setup, but I'd love to know if anyone else has this happen, and if they find out why:
If I launch an .sln file by double-clicking it, it will load VS and I can right-click the Solution and get Properties to come up no problem.
If I go to "Open Project" on the Visual Studio welcome page or from File > Open > Project/Solution, navigate to the .sln file and launch it by selecting it and clicking "Open" in the File dialog, that's when I have this issue.
I'm going to just always launch the .sln file from now on, but I'd love to know why this happens when using "Open Project" from the welcome page or from File > Open > Project/Solution! I tried going into Tools > NuGet Package Manager > General and I unchecked the options for allowing NuGet to download missing packages and Skip applying binding redirects, and under Package Sources I de-selected the checkboxes (my dev machine does not connect to the internet). Environment > Extensions and Updates: I tried it with and without "Load per user extensions when running as administrator" and running it as an Admin and without running as Admin. Also tried just deleting everything at C:\Users\me\AppData\Local\Microsoft\VisualStudio. No change from those 2 bullets above.

Error loading DefaultTemplate.xaml in designer

I can't load my projects' DefaultTemplate.xaml file in the designer. (using VS2010 premium, recently reinstalled)
When loading the DefaultTemplate.xaml from the build templates in TFS, I get an error saying that the activity cannot be loaded.
There are errors loading the namespaces. Somehow it cannot find the assemblies needed for TFS.
In the errors list I get about 50 complaints about these namespaces.
I've poked around in it, but never commited any changes. I've tried restoring the original version, but that didn't work.
I've tried replacing the template with the DefaultTemplate.xaml from another project, but I got the same error. I'm at a loss here. How can I fix my VS2010 or template so I can edit it again using the designer?
I can open other projects' DefaultTemplate.xaml files in the designer without any problems.
I suspect that it has to do with some setting in VS2010 or my project somehow not having the right references, but I can't figure out what's wrong or how to solve it.
Hope this or this will address your issue.
Edit:
If above doesn't work try below, you may get more descriptive error by using this. This works for windows applications on VS2008. I've never tried this with VS2010. You can debug your devenv.exe instance by another devenv.exe. Below are the steps. Give it a go...
1) Start a second instance of visual studio
2) go the the Tools menu, "Attach to process", select the 'devenv.exe' process, and click the 'attach' button.
3) In the Debug/Exceptions menu Turn on exception catching when first thrown (in the Debug->Exceptions menu).
4) Open the designer with the debugger attached
5) The second visual studion will break on your error.

Visual Studio 2010 hangs on loading web.config

I have a weird situation: Visual Studio 2010 will hang up indefinitely on me when opening certain websites. It prompts me for my credentials and loads up much of the project tree, and then just hangs at the "Preparing Solution..." dialog, which just then never goes away. In every case, the status bar of VS says that it is currently loading web.config.
It only happens on some websites, not all, but the websites that do fail, they all open without any problem in Visual Studio 2008. So it almost seems like 2010 is having some sort of problem parsing web.config files under certain circumstances (unless of course that web.config message was just the last file to load and it's actually crashing on the next step).
I've tried disabling all my add-ins and extensions, which did not help.
This turned out to be an extension which needed to be updated. In short, if VS says your extensions need updating, then update them. BEFORE trying to open a project, otherwise you may have problems.

Visual Studio 2005 - can not open form on designer

My team developed a GUI application on Visual Studio 2005, managed C++. Since some deliveries it is not possible to open the form in the designer, even if the source code and the project settings have not been changed. The designer reports this error:
Exception of type 'System.OutOfMemoryException' was thrown.
at Microsoft.VisualStudio.Design.VSDynamicTypeService.ShadowCopyAssembly(String fileName)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(String codeBase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
...
We successfully recompiled the project but we still encounter this problem.
Any idea?
This is how I used to debug these issues, Start a second instance of visual studio, load your project and attach to the first instance which also has the project loaded. Now set a breakpoint in the constructor and Page Load events and also any custom paint events that you may have in the form in the second instance and try to open the designer in the first instance, the breakpoints should get hit and you should be able to see what's going on.
I suspect that you have a Design Mode error where an infinite loop (or recursive control creation) occurs on the concerned Form.
One thing that helped me in these kinds of error on Windows Forms would be the following:
Open your Visual Studio 2005 solution for your GUI application. Don't open your form yet
Open another instance of Visual Studio 2005
In the second instance, Attach (Debug -> Attach to Process) the first instance of devenv.exe to the debugger. Make sure exceptions (Debug -> Exceptions) have all exceptions checkboxes under "Thrown" checked.
Now go to your first VS2005 instance and open the form. The second VS2005 instance will stop at the line where the error occurs.
This is a long shot, but try closing and opening the designer several times in a row. I have had the same kinds of problems with the C# Windows Forms designer (VS2005) : the form usually ended up opening correctly (after 5 tries, quite consistently).
I've run into the same issue intermittently when working with a large multi-project solution, or a project with an exceedingly large and complicated windows form.
I was able to solve the problem by enabling Visual Studio to use more than 2GB of memory. Here's the process...
(note: this assumes XP and Visual Studio 2005 - Vista and/or VS2008 will require slight changes)
Edit Boot.ini
Right-click My Computer, properties, Advanced tab. Under Startup and Recovery click Settings. Click the Edit button, and add the /3GB switch to the end of the [operating systems] line:
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB
Make Visual Studio "Large Address Aware"
Run a Visual Studio Command Prompt, and change to the IDE directory:
cd %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE
Use the microsoft tool editbin to modify devenv.exe:
editbin /LARGEADDRESSAWARE devenv.exe
Now reboot, and you're done!

Resources