1

I get the following error when scaffolding the model 'Sender'. The sender model is in a class library project called BmbMessenger.Data and this project's dll is referenced in BmbMessenger.AccountManager but for some reason the 'Sender' model cannot be referenced to enable scaffolding run properly. I also tried using the gui scaffolding tool but to no avail. I confused as to why the scaffolding is not working.

Scaffold Controller Switch -DbContextType BmbMessengerContext -Verbose -Repository -Project BmbMessenger.AccountManager -ModelType Switch
Get-ProjectType : Cannot find a type matching the name 'Switch'. Try specifying the fully-qualified type name, including namespace.
At C:\Users\Andrew\Documents\Visual Studio 2012\Projects\BmbMessenger\packages\MvcScaffolding.1.0.9\tools\Controller\MvcScaffolding.Controller.ps1:50 char:35
+     $foundModelType = Get-ProjectType <<<<  $ModelType -Project $Project
    + CategoryInfo          : NotSpecified: (:) [Get-ProjectType], InvalidOperationException
    + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.GetProjectTypeCmdlet
abatishchev
  • 98,240
  • 88
  • 296
  • 433
plasteezy
  • 257
  • 6
  • 14

1 Answers1

0

As you add a new model, change your model, or import an existing model, you should first build your project and then try to use the .tt entity classes as models for scaffolding.

Hope that helps

Amin Saqi
  • 18,549
  • 7
  • 50
  • 70