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

Incorrect ResourceManager path for RESX #60

Open
jsgoupil opened this issue Aug 17, 2018 · 7 comments
Open

Incorrect ResourceManager path for RESX #60

jsgoupil opened this issue Aug 17, 2018 · 7 comments

Comments

@jsgoupil
Copy link

With the new version 2.1.0, there is a RESX being created alongside the .cs and Designer.cs, however, the path mentioned in the designer does not work properly.

After calling dotnet ef6 migrations add ConditionEntryToCondition

I get

private readonly ResourceManager Resources = new ResourceManager("Bolt.Models.Migrations.201808172122519_ConditionEntryToCondition", typeof(ConditionEntryToCondition).Assembly);

But it should be:

private readonly ResourceManager Resources = new ResourceManager("Bolt.Models.Migrations.ApplicationDbContext.201808172122519_ConditionEntryToCondition", typeof(ConditionEntryToCondition).Assembly);

If I run dotnet ef6 database update

I get the following:

Target migration: latest
Unhandled Exception: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Bolt.Models.Migrations.201808172122519_ConditionEntryToCondition.resources" was correctly embedded or linked into assembly "Bolt.Models" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Generated code says:
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]

@mrahhal
Copy link
Owner

mrahhal commented Aug 18, 2018

Why would there be a ".ApplicationDbContext" added? How are you organizing your folders? The migrations should be inside their own folder.

@jsgoupil
Copy link
Author

I migrated from a project that had 2 contexts. Each of them are in their own folder

/Migrations/ApplicationDbContext/Configuration.cs
/Migrations/ApplicationUserDbContext/Configuration.cs

In this specific project, I don't have the 2nd context, but I always had it setup with the /ApplicationDbContext/ folder. Since the new .net core and this update of Migrator EF6, this new RESX is output without the correct assembly.

@mrahhal
Copy link
Owner

mrahhal commented Aug 18, 2018

Are you sure you're using the --output option? I'm pretty sure this is accounted for. If possible, show me the project structure and what commands you're using.

@jsgoupil
Copy link
Author

-o does not work, it does not drop it at the right place. I use to do

dotnet ef migrations add TheName

Screenshots:
image

@mrahhal
Copy link
Owner

mrahhal commented Aug 19, 2018

So you're telling me you don't use -o? Now first of all, it's natural that the output place and the migration resource name will be wrong. What do you mean exactly by -o doesn't work..?

@jsgoupil
Copy link
Author

I never used -o. When I use it, it creates a file here.

-o ApplicationDbContext
image

-o Migrations.ApplicationDbContext
image

When I don't use -o, your code puts the file in the right folder, it's only the namespace that is incorrect.

image

@jsgoupil
Copy link
Author

All of this worked just fine before RESX showed up. dotnet ef migrations add TheName , before ef6, it was working just fine.

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

2 participants