Skip to content

AddUsingDirectiveIfNeeded is whitespace-sensitive #1788

Open
@yecril71pl

Description

@yecril71pl

File a bug

Include your code

using Microsoft .Extensions .DependencyInjection;

Include stack traces

      System.AggregateException: One or more errors occurred. (There was an error creating a DbContext :/home/dell/prog/Scaffolding/tools/dotnet-aspnet-codegenerator/Startup.cs(7,7): warning CS0105: Dyrektywa using dla elementu „Microsoft.Extensions.DependencyInjection” już wystąpiła w tej przestrzeni nazw
         at Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.EntityFrameworkModelProcessor.Process() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.EFCore/EntityFrameworkModelProcessor.cs:line 226
         at Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.EntityFrameworkServices.GetModelMetadata(String dbContextFullTypeName, ModelType modelTypeSymbol, String areaName, Boolean useSqlite) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.EFCore/EntityFrameworkServices.cs:line 138
         at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.ModelMetadataUtilities.ValidateModelAndGetEFMetadata(CommonCommandLineModel commandLineModel, IEntityFrameworkService entityFrameworkService, IModelTypesLocator modelTypesLocator, String areaName) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/ModelMetadataUtilities.cs:line 52
         at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Razor.EFModelBasedRazorPageScaffolder.GenerateCode(RazorPageGeneratorModel razorGeneratorModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/RazorPage/EFModelBasedRazorPageScaffolder.cs:line 93
         at Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Razor.RazorPageGenerator.GenerateCode(RazorPageGeneratorModel razorPageGeneratorModel) in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Mvc/RazorPage/RazorPageGenerator.cs:line 82
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
         at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
         at System.Threading.Tasks.Task.Wait()
         at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__8_0() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Core/ActionInvoker.cs:line 102
         at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) in /home/dell/.nuget/packages/microsoft.extensions.commandlineutils.sources/6.0.0-preview.3.21166.3/contentFiles/cs/netstandard1.0/CommandLine/CommandLineApplication.cs:line 374
         at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG.Core/ActionInvoker.cs:line 54
         at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute() in /home/dell/prog/Scaffolding/src/Scaffolding/VS.Web.CG/CodeGenCommand.cs:line 93

Include provider and version information

Microsoft.VisualStudio.Web.CodeGeneration.Design/Microsoft.DotNet.MSIdentity version:
1.0.0
Target framework: (e.g. .NET 5.0)
6.0.1
Operating system:
Linux x64 5.15.12-1-default
IDE: (e.g. Visual Studio 2019 16.3)
1.63.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions