EFCore.Pluralizer
EFCore.Pluralizer copied to clipboard
Could not load file or assembly Bricelam.EntityFrameworkCore.Pluralizer
Hello, Brice! Im having trouble using pluralizer on NETCore 3.1 + EFCore.3.1.1
running Install-Package Bricelam.EntityFrameworkCore.Pluralizer
- ok
on Scaffold-DbContext
I get this exception
System.IO.FileNotFoundException: Could not load file or assembly 'Bricelam.EntityFrameworkCore.Pluralizer, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Bricelam.EntityFrameworkCore.Pluralizer, Culture=neutral, PublicKeyToken=null'
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.ConfigureReferencedServices(IServiceCollection services, String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DesignTimeServicesBuilder.Build(String provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Could not load file or assembly 'Bricelam.EntityFrameworkCore.Pluralizer, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
dont have any idea why is that, please help
Do you have multiple projects? If so, make sure you install it into your startup app
Also, there is a workaround: you can remove the contents of PackageReference tag to Bricelam.Xxx (IncludeAssets etc), then it works with other assemblies too.
Note to self: Consider using transitive build artifacts.