Closed omerlh closed 8 years ago
Is this your issue? https://github.com/IdentityServer/IdentityServer3.EntityFramework/issues/72#issuecomment-180094260
Update to the latest to get the AutoMapper updates: https://github.com/IdentityServer/IdentityServer3.EntityFramework/releases/tag/2.4.1
Not looking the same exception, I am not sure. I am using the latest version on identityserver entityframework (2.4.1). Automapper version is 4.2.0
Well, then the only other thing I can think of is that your connection string "Data Source=LocalDB)\v11.0; Initial Catalog=Northwind; Integrated Security=True; "
doesn't look anything like a MySql connection string.
I know that the connection to the storage work, it is failing in the line of the mapping, e.g.:
context.Clients.Add(client.ToEntity());
And the exception is from the mapper...
And you're using IdSvr 2.4 and EF 2.4.1?
Yes, that’s what weird…
From: Brock Allen [mailto:notifications@github.com] Sent: Tuesday, February 9, 2016 4:43 PM To: IdentityServer/IdentityServer3.EntityFramework IdentityServer3.EntityFramework@noreply.github.com Cc: Omer Levi Hevroni omerl@soluto.com Subject: Re: [IdentityServer3.EntityFramework] Exception while trying to create a client and store it to mysql db (#90)
And you're using IdSvr 2.4 and EF 2.4.1?
— Reply to this email directly or view it on GitHubhttps://github.com/IdentityServer/IdentityServer3.EntityFramework/issues/90#issuecomment-181896321.
Ok, not sure then. The only thing I can suggest is comparing your code to the working sample: https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/EntityFramework
I’ve tried that, by the working example doesn’t contain any example of inserting data. I also tried to run the administrative too, but the same error occurred…
I think it does at startup time: https://github.com/IdentityServer/IdentityServer3.Samples/blob/master/source/EntityFramework/SelfHost/Config/Factory.cs#L24
Ok, I will give it a try and update here. Thanks!
Update: I've just cloned the examples repository and tried to run the entity framework examples, but the same error occurred...
And you created the database with migrations, as we suggest: https://identityserver.github.io/Documentation/docsv2/ef/migrations.html
I didn't know I should, I just cloned the repo of the examples... Any way even trying to apply the migration result in failure, like this one (on add migration): Unable to generate an explicit migration because the following explicit migrations are pending: [201502141840088_InitialCreate, 201504070215165_v2_0_0, 201511200152080_v2_2_0, 201512191738380_v2_3_0, 201601182228505_v2_4_0]. Apply the pending explicit migrations before attempting to generate a new explicit migration.
I just cleared my DB and re-ran the migrations on the EF sample and it's all working. It must be some problem in your environment.
OK, I will try again. Any tips about setting the environment?
Sent from Outlook Mobilehttps://aka.ms/blhgte
On Mon, Feb 22, 2016 at 7:45 AM -0800, "Brock Allen" notifications@github.com<mailto:notifications@github.com> wrote:
I just cleanred my DB and re-ran the migrations on the EF sample and it's all working. It must be some problem in your environment.
Reply to this email directly or view it on GitHubhttps://github.com/IdentityServer/IdentityServer3.EntityFramework/issues/90#issuecomment-187237859.
No, I used SqlServer LocalDb that comes with VS, and I ran the 3 update-database commands from the sample project.
Ok, I will give it a try
From: Brock Allen [mailto:notifications@github.com] Sent: Tuesday, February 23, 2016 3:54 PM To: IdentityServer/IdentityServer3.EntityFramework IdentityServer3.EntityFramework@noreply.github.com Cc: Omer Levi Hevroni omerl@soluto.com Subject: Re: [IdentityServer3.EntityFramework] Exception while trying to create a client and store it to mysql db (#90)
No, I used SqlServer LocalDb that comes with VS, and I ran the 3 update-database commands from the sample project.
— Reply to this email directly or view it on GitHubhttps://github.com/IdentityServer/IdentityServer3.EntityFramework/issues/90#issuecomment-187707882.
Ok, I tried again. Just installed fresh new SQLExpress on my machine, connect to it from visual studio and copied the connection string, which now look like that:
<add name="IdSvr3Config" connectionString="Data Source=[machine name]\SQLEXPRESS;Initial Catalog=master;Integrated Security=True" providerName="System.Data.SqlClient" />
But, still the same errors when trying to enable migrations or to run the sample. So I really don't know what the problem could be...
Update: I've managed to run the migration after deleting the migration folder in the example. But, also after migration completed successfully, the same error occurred.
Did you ever sort this out?
Nope, I just give up and did not use this...
Hey, I've tried to run the following code:
I am trying to create some demo data in the storage in order to test my service. When I run this code, the mapping from model to entity failed with the following exception:
And I can't understand what it try to convert... Could you help? Thanks!