Design/Split hanging in Webform - asp.net

Until about an hour or so ago, I had no problems with Visual Studio - I could view my webforms, make changes etc. All of a sudden, clicking Design or Split just hangs. I don't get an error, it just sits there. I can close the form, but going back into Design view for any for webform does the same thing.
I created a new blank web project, added a blank Default.aspx page - same issue.
I have tried restarting the computer, creating a new windows user and trying on that account and installing AspNet5.ENU.RC1_Update1_KB3137909 (which was an update that was showing up in Visual Studio).
Nothing is working, anyone know of any tips that might get it working?
EDIT:
If I close the webform and right click it in Solution Explorer and view markup and then click Shift-F7 to get design view, I get the following error:
Class not registered looking for object with clsid {A53914B4-1C62-4D60-8E8D-C7B67B4DFF87}

After googling for a long time and trying lots of different approaches, the only successful approach was running the Visual Studio installer and selecting Repair.
This took the better part of an hour to run, but has corrected the issue.
For what it is worth - the issue: Class not registered looking for object with clsid {A53914B4-1C62-4D60-8E8D-C7B67B4DFF87}
Seems to point to an error in the fpeditax.dll in the Common7\Packages folder
So final solution: Run a Repair from the installer.

Do two things:
1) right click the file you want to edit, and select "Open With" - make a note of which editor is the default, you'll need that later. Now, choose a different editor, and set that as default.
2) If (1) works, it's the editor that is jamming up, and you should do this:
Start visual studio from a command line with this line:
devenv.exe /ResetUserData
you may want to delete the ".vs" folder in your project at the same time.
Now, do the same thing, right click the file, set BACK the default editor you took a note of, and you should be OK. This usually solves most of the issues related to a specific file type not wanting to work

Related

Visual Studio C# ASP .NET Web Form Designer Error

Ok, so I start a new project in Visual Studio (currently updated to update 3) and choose ASP.NET Web Application (.NET Framework).
Then I choose the Empty template and to add the folders and core references for Web Forms.
Ok, great, so I add a webform to the project and then find there's a problem:
Design view or even Split view is not available for the new aspx page.
Pressing the buttons 'Design' or 'Split' do nothing and only the source is seen, which also becomes uneditable.
Now I have seen this issue before and searched and searched for an answer. But the only solution was a complete reinstall - this means a few GB download and then hours of the install program doing whatever it does (it is the slowest install for anything on any platform).
This issue seems to occur randomly, and once it occurs, it seems to be permanent, short of a complete reinstall of VS.
Is this a fault in Visual Studio that will never be fixed?
Does someone actually know how to fix this other than a complete reinstall?
Please do not suggest to try 'Open With' on the aspx file - yes I have tried every option and the original default is the correct one.
Answers from the Microsoft forum are about as helpful as giving wheels to a tomato, such as here. It has even been highlighted for Visual Studio 2008 here. Someone seems to have tried to raise the issue last year here.

Visual Studio 2010SP1 locks up when typing class=" in MVC3 project using razor

Sometimes, not always, Visual Studio locks up when typing class=" on any element. This doesn't happen all the time and I can't seem to identify a pattern other than VS has usually been running for a while.
Also, I have ELMAH installed and set to email me on exceptions. Relatively often, although not always I get an email when typing class=" like below. Why would it be trying to start the project when typing class?
System.Web.HttpException: The controller for path
'/Views/TechSupport/#Url.Content(' was not found
or does not implement IController.
To resolve the issue I restart Visual Studio. Sometimes the problem persists and I need to restart it again. Usually it works properly at that point, without the above ELMAH email. If not then I reboot.
This is my only MVC project, so I don't know if it's specific to this project or not. It did seem to happen very early on in the development process though. This only happens when I type class=", nothing else triggers a crash/lockup.
EDIT - ADDITIONAL INFO:
For some reason, when I just typed class=" an error dialog box popped with the message
Cannot load "c:\Progra~1\MICROS~2.0\Common7\Packages\vwd\mso.dll"
When I click OK I get a second dialog box that says
Visual Studio has encountered an exception. This may be caused by an extension.
It then goes on to suggest I use the /log parameter when start VS, which I will be trying now.
I was having the same issue and found that by going to the Extension Manager -> Online Gallery and search install the Web Standards Update for Microsoft Visual Studio 2010 sp1 Fixes it.
You may have to uninstall it and re-install it if it's already installed.
Update
Here is some other info that may help:
http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/c249aa35-ed66-431a-9cc3-03b0b84f5f21/
http://social.msdn.microsoft.com/Forums/en/csharpide/thread/ac74d91c-b76d-49a3-b599-a8f19df9303a
http://connect.microsoft.com/VisualStudio/feedback/details/727091/visual-studio-crashes-when-editing-an-mvc-4-beta-cshtml
Open Options->Text Editor->CSS->Miscellaneous and disable "Statement Completion"
Also in the General section there are other "Statement Completion" options.
Try closing the project, deleting the contents of the "bin" folder inside the Project folder (you might backup your project before), then re-open the project.
As a last resort you can try creating a new project and re-importing the project & code files, or even repairing/re-installing VS.
Try "Enable Insert attibute value quotes when typing" on Tool -> Options -> TextEditor -> HTML -> Formatting

TFS 2010 - TF14040 The Folder may not be checked out

I have a .NET 4 website in VS2010 stored in a TFS 2010 team project. I need to add a reference to System.Data.Linq.dll to the website. I am referencing a LINQ DataContext that is defined in another project and I get build errors saying that I need the reference to System.Data.Linq. I go up to the "Add Reference" menu option and add it like I would any normal reference, and it even shows up in the Web.config and in the Properties pages for the website... BUT if I build I still get the same error.
So I found a place in my code where I was referencing the LINQ count function and it told me it was invalid because I was missing a reference and it offered to add the reference automatically. I told it to add the reference automatically and it is at this point that I get the error mentioned in the subject:
TF14040: The folder $/Folder/Subfolder may not be checked out. No items were checked out
I've done some research online but I haven't been able to find much. I saw on a blog that making the folder not readonly fixed the issue for him, but it didn't seem to work for me unless I misunderstood something.
I tried loading up the project from source control onto a fresh computer where that project had never been loaded before and I can reproduce the issue the same way. Help would be greatly appreciated.
FWIW, this error also occurs in different circumstances. I had the same error today from the command line when trying to use tfs checkout SomeFolder /login:user,password, although this was not within the context of an asp.net app, I'm currently working on dependency replication. For me, adding the /recursive command worked, like this:
tfs checkout SomeFolder /recursive /login:user,password
The hint to try that came from here, by the way.
I have no idea if this is your problem but I've noticed that TFS2010 seems to have some bug somewhere around folder renames/deletes/changes or something. The bugs seem to go away when you check everything in and try again after the folder change has been saved to source control. I have hit this issue a dozen times this week but don't know exactly what the scenarios are. It's quite frustrating.
I figured it out, but it's a little strange. I had some build errors that I hadn't fixed yet, also my web.config file used to be for a 3.5 SP1 site and I upgraded the site to 4.0. Somewhere along the line the build errors and the web.config combined to form this strange weird error that apparently has nothing to do with TFS.
I figured it out by creating a new website and slowly moving over portions of my site to that new site. Things didn't go totally crazy until I moved over my web.config. So I went back and updated my web.config file so that it more closely matched the way a .Net 4 web.config should by trimming out a lot of stuff and now things are good and building fine. Thanks for the help.

References failing to import to a VS 2005 (VB) ASP.NET Web Service Application Project

I have this VB ASP.NET Web Service Application project running VS 2005. I'm trying to add references. To do so I click on the "Properties" icon in the Solution Explorer window which presents me with a window to add/update/remove references. I click "Add", I select the reference I want and then "OK". Lo en behold, NOTHING! It simply won't add references (I tried adding several different ones). Specifically I'm trying to add the System.Configuration assembly.
I'm not sure why this is happening, but perhaps another clue to the puzzle is that I also see no "References" folder in the Solution Explorer nor can I view it by clicking the "Show All Files" icon since it's greyed out.
Maybe I'm missing something obvious, I'd be grateful if someone could shed some light on this problem.
P.S: The project is source-controlled using VSS, although it had no effect when I checked out the entired project.
*Progress Updates:
Modified project folder & file permissions, no effect.
Scanned through paths in project source files, they are pointing to correct locations (not that I can see why that would have an effect).
Tried to create a new project and adding the existing project files, this fails horribly.
Stared blankly at the screen for minutes at a time. Forcibly willing it to work has no effect.
After a lot of frustration, cupous amounts of caffiene and nictotine, I managed to find the problem. When you "Get Latest Version" on a folder, be sure to "Set Working Folder" on the root of your VSS database. If you don't do that, the original project code may be duplicated under the main solution file like this:
C:\Projects\MyAwesomeProject
C:\Projects\MyAwesomeProject\MyAwesomeProject
From that you should be able to gather that now you have duplicate code and duplicate configuration files that both gets treated as the main app.config/web.config. Changes made in one is not reflected in the other. When you try to add references it technically adds it to one, but not to the other, also causing VSS not to "show" the references in the solutions property pages.
I second-guessed myself on this one, since I took the project over from a previous developer that didn't set the working folder when he did "Get Latest Version" and check all of the duplicate files created as a result back into VSS. My question was basically "Which one is the right one?".
Deleting "C:\Projects\MyAwesomeProject\MyAwesomeProject\" = Build Successfull.
Happy programming!

Edit source code when debugging

I have VS2005 and I am currently trying to debug an ASP.net web application. I want to change some code around in the code behind file, but every time I stop at a break point and try to edit something I get the following error message: "Changes are not allowed when the debugger has been attached to an already running process or the code being debugged is optimized."
I'm pretty sure I have all the "Edit and Continue" options enabled. Any suggestions?
This may seem counter-intuitive, but turn edit and continue off.
There might be another "allow me to edit read-only files" or "allow me to edit even when I am debugging...no really!" setting somewhere, but I don't have 2005 to look at to check.
In 2008, turn off edit and continue and you can edit while it's running (but those changes aren't appplied.)
If you actually want to use edit and continue, you also have to enable it for the project, on the web tab of the project settings.
The application is actually running off of a compiled version of your code. If you modify it it will have to recompile it in order for your changes to work, which means that it will need to swap out the running version for the new compiled version. This is a pretty hard problem - which is why I think Microsoft has made it impossible to do. It's more to protect you from THINKING some changes were made when they really weren't.
For Asp.net it is possible to think of two types of 'edit and continue'.
One is a classic edit and refresh the browser. This works because the browser refresh recompiles everything except precompiled code behind files. This is not referred to as Edit and Continue, though in practice it provides a similar effect. In this mode you cannot change code behind files, because they were precompiled and deployed, but you can change just about anything else.
Another mode allows you to change precompiled code behind files but nothing else ... (this is the mode Chris Bilson mentions which needs to be set on the project properties for ASP.Net). In this case you are using the Edit and Continue feature of the debugger, which knows preciously little about ASP.net. The debugger just sees a loaded .Net assembly and can modify it when stopped in the debugger because there is a project in the solution that claims to know how to build it. In this case you are prevented from modifying things that would otherwise mess up the debugging session. This method however is the only way to change the code while it is running rather than requiring a browser refresh.
You are allowed to make changes to the *.aspx file while it runs, and you can hit refresh on your web instance to see those changes immediately. However, you cannot make changes to the *.cs/*.vb or *.designer.cs/*.designer.vb files while the program runs.
I search for this on Visual Studio 2008 WAP (Web Application Project) and it took me two days to find the solution, so here it is in the hopes it helps somebody else:
There are two locations that have to be checked, one it under tools-options-debugging-Edit And Continue-Enable Edit And Continue, the other is right click project-properties-Web-Enable Edit And Continue
For the record, I had a similar problem with VS 2008 and a different solution resolved the problem for me. Editing code in Visual Studio 2008 in debug mode
Check that you are not in release mode.
In release mode you cannot edit your code while debugging. Just change mode to Debug

Resources