tags:

views:

127

answers:

3

I am doing an MVC project... am very new to MVC... something very strange is happening...

When i drop a control from the toolbox to the design page visual studio closes.. i have no clue why this happens.. am totally perplexed...i tried searching for possible solution in the net...nothing showed up...:(

thanks in advance...

A: 

Try to start Visual Studio in safemode via

cd C:\Program files\Microsoft Visual Studio 9.0\Common7\IDE
devenv.exe /safemode /log

If this works then one of the installed add ons is responsible for the crash. It often helps in my environment.

Malcolm Frexner
tried it...it still quits...the only add-on i did off late is MVC...:(
ZX12R
+1  A: 

Unless I've totally missed the boat, you shouldn't be able to drag-and-drop any control from the toolbox to an MVC view. At least in MVC 1.0, views and user controls do not implement code-behind by default, but, more importantly, the designer code file that gets modified in WinForms .ASPXs and .ASCXs is not created when the view is created. In MVC, controls are added to views using code-based HTML helpers or the actual HTML code. The fact that the default Visual Studio behavior when executing a drag-and-drop with a toolbox control is to modify the form's designer file could be causing the immediate exit, since the file doesn't exist.

P.S. Don't bother trying to create it...the framework isn't built to implement or support it and it would probably just slow you down, anyway.

Neil T.
oh...thanks...:) totally missed...my bad..
ZX12R
A: 

Also you may try cleaning up the project.
Run
c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe yoursolution.sln /t:Clean
Might help if something got screwed in your project.

Bolek Tekielski
but i think Neil T is correct...MVC projects are not meant to be used that way without proper views..isn't it..?
ZX12R
MVC is a code-based framework. The drag-and-drop behaviors that you got with WebForms don't work with MVC. If you want to add a control to a view, you either have to modify the HTML source or submit the source through a controller action method. The toolbox is useless.
Neil T.
@Neil:i totally agree with you...but why does the studio allow us to do it..?
ZX12R
It's because ASP.NET MVC was built somewhere after the release of VS 2008 and it was released as an value add-on/feature. I think this should be corrected in VS 2010 version.
mare
@Mark: lets hope...
ZX12R