Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new scaffolded item error (Bug) #984

Closed
Yuant-tobing opened this issue Apr 21, 2019 · 10 comments
Closed

Add new scaffolded item error (Bug) #984

Yuant-tobing opened this issue Apr 21, 2019 · 10 comments

Comments

@Yuant-tobing
Copy link

Scaffolding items for:

  • API Controller with actions, using Entity Framework
(Error : Method not found: System.Type.Microsoft.EntityFrameworkCore.Metadata.Iproperty.getClrType()'.')
  • MVC Controller with views, using Entity Framework
(Error : Method not found: Boolean Microsoft.EntityFrameworkCore.Metadata.Iproperty.getlsShadowProperty'.')

Steps to reproduce:

  • Add new project
  • Add context and etc..
  • Add migration data by PMC command "Add-Migration ProjectInitialCreate"
  • Update database by PMC command "Update-Database"
  • Add new scaffolded items (ERROR)

Target framework(s):

ASP.NET Core SDK v 3.0.0-preview4.19212.13

Package version

<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
@Duelbat
Copy link

Duelbat commented May 13, 2019

Any news on this issue ? This error is occurring in core 3.0.0 preview 5 as well .

@BehzadA
Copy link

BehzadA commented May 14, 2019

Any news on this issue ? This error is occurring in core 3.0.0 preview 5 as well .

#986 (comment)

@crbeckman
Copy link

Still an issue. Changed "" to "". Using Visual Studio Community 2019 Version 16.0.4. Scaffolding issues have been around for numerous preview builds and still an issue with 2019 16.0.4.

@crbeckman
Copy link

Sorry, it seems my package references were deleted. they were codegeneration.Design version2.2.3 changed to version 3.0.0-preview5-19264-04.

@Rick-Anderson
Copy link
Contributor

@seancpeters can we get an ETA on when this will be fixed. I can't update my tutorials for 3.0 until this is fixed. Do you have a work-around?
dotnet --version
3.0.100-preview7-012801
Error

dotnet aspnet-codegenerator razorpage -m Contact -udl -dc ApplicationDbContext -outDir Pages\Contacts --referenceScriptLibraries
Building project ...
Finding the generator 'razorpage'...
Running the generator 'razorpage'...
Attempting to compile the application in memory.
Attempting to figure out the EntityFramework metadata for the model and DbContext: 'Contact'
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 3.0.0-preview7.19352.17 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
Method not found: 'Boolean Microsoft.EntityFrameworkCore.Metadata.IProperty.get_IsShadowProperty()'.
   at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
   at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)

@Rick-Anderson
Copy link
Contributor

@seancpeters using the latest VS19 preview, I was able to scaffold so it's not urgent for me.

@vijayrkn
Copy link
Contributor

vijayrkn commented Nov 7, 2019

This is fixed in the latest version.

@vijayrkn vijayrkn closed this as completed Nov 7, 2019
@guilhermesoatto
Copy link

I have the same problem
image

using the last version
try to add scaffold item using netcore 3.1

@jrkcoder
Copy link

jrkcoder commented Feb 5, 2021

Just hit this using ASP.NET Core 5.
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Tool 'dotnet-aspnet-codegenerator' (version '5.0.1') was successfully installed.
PM> aspnet-codegenerator razorpage -m Contact -udl -dc ApplicationDbContext -outDir Pages\Contacts --referenceScriptLibraries
aspnet-codegenerator : The term 'aspnet-codegenerator' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1

  • aspnet-codegenerator razorpage -m Contact -udl -dc ApplicationDbConte ...
  •   + CategoryInfo          : ObjectNotFound: (aspnet-codegenerator:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

PM>

@jrkcoder
Copy link

jrkcoder commented Feb 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants