Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd View Model class dropdown not showing my class
    primarykey
    data
    text
    <p>I’ve created a new C# asp.net mvc 4.0 (beta) Internet Application and I’m having a somewhat odd behavior in the Add View dialog in Visual Studio 2010 (sp1). When I decide to create a strongly-typed View, inside the Add View dialog, the Model class dropdown does not show my ViewModel class. </p> <p><em>For the record, yes I did compile the application before triggering the Add View dialog.</em></p> <p>I believe I have pinpointed the issue but do not know how to fix it. Below are the repro-steps if anyone cares to reproduce the behavior:</p> <ol> <li>In Visual Studio 2010 (sp1), create a new C# asp.net MVC 4.0 (beta) Internet Application.</li> <li>Inside the Models folder, create a new simple class called “GazouViewModel.cs”</li> <li>Build the application, open the HomeController, right-click the Index() ActionResult and select Add View…</li> <li>In the Add View dialog, check the “strongly-typed view” checkbox and in the Model class: dropdown, you’ll notice your “GazouViewModel”</li> </ol> <hr> <ol> <li>In Solution Explorer, right-click your project and select “Manage NuGet Packages”</li> <li>Search, find and install the “Bootstrapper.Autofac” package.</li> <li>Rebuild the application and verify if your “GazouViewModel” still displays inside the Add View dropdown’s dialog.</li> <li>The “GazouViewModel” should still be displaying in the dropdown.</li> </ol> <hr> <ol> <li>In Solution Explorer, right-click your project and select “Manage NuGet Packages”</li> <li>Search, find and install the “Autofac ASP.NET MVC4 (Beta) Integration” package.</li> <li>Rebuild the application and verify if your “GazouViewModel” still displays inside the Add View dropdown’s dialog.</li> <li>The “GazouViewModel” should still be displaying in the dropdown.</li> </ol> <hr> <ol> <li>In Solution Explorer, right-click your project and ADD a new class (Class1.cs) anywhere it doesn’t matter.</li> <li>Make that Class1 implement IAutofacRegistration and implement the interface.</li> <li>Rebuild the application and verify if your “GazouViewModel” still displays inside the Add View dropdown’s dialog.</li> <li><strong>The “GazouViewModel” is no longer showing inside the Model class dropdown.</strong></li> </ol> <p>It appears that as soon as I create a class that implements the <code>IAutofacRegistration</code> interface and build the application, I’m no longer capable of viewing my ViewModels in that dropdown.</p> <p>Can anyone confirm if they are getting the same results as me? And more importantly, how can one fix this?</p> <p><strong>IMPORTANT</strong>: I have tried the exact same steps with an mvc 3.0 application and the exact same behavior occurs…so this is not relevant to the BETA version.</p> <p>Sincerely Vince</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload