Skip to content
New issue

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

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

Already on GitHub? # to your account

identity generator not compatible with old style entrypoint length must be a non-negative value Scaffolding Fails with Old-Style Entrypoint Programs #3045

Open
bukowa opened this issue Oct 27, 2024 · 2 comments

Comments

@bukowa
Copy link

bukowa commented Oct 27, 2024

$ dotnet aspnet-codegenerator identity -dbProvider sqlite
Building project ...
Finding the generator 'identity'...
Running the generator 'identity'...
length ('-639') must be a non-negative value. (Parameter 'length')
Actual value was -639.
   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)
RunTime 00:00:32.26
<Project Sdk="Microsoft.NET.Sdk.Web">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

    <ItemGroup>
      <PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
      <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.0" />
      <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
      <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
        <PrivateAssets>all</PrivateAssets>
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      </PackageReference>
      <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
      <PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
      <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.9.0" />
    </ItemGroup>

</Project>
$ dotnet --version
8.0.403
@bukowa
Copy link
Author

bukowa commented Oct 27, 2024

aspnet-codegenerator identity won't work when your application is using class Program static Run(string[] args) top level statement
Adding this code causes the error
Image
incompatible

@bukowa bukowa changed the title length ('-639') must be a non-negative value dotnet aspnet-codegenerator identity identity generator not compatible with old style entrypoint length must be a non-negative value Oct 27, 2024
@bukowa bukowa changed the title identity generator not compatible with old style entrypoint length must be a non-negative value identity generator not compatible with old style entrypoint length must be a non-negative value Scaffolding Fails with Old-Style Entrypoint Programs Oct 27, 2024
@deepchoudhery
Copy link
Member

Will take a look at this bug soon but for a workaround, please try our new command-line scaffolding tool, dotnet-scaffold

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants