I have addressed the issue. The root cause is using a incorrect version of MySql.Data.Entity. the latest stable version of MySql.Data.Entity is 6.9.9, so before I use it. But since the abp sample project is using .net framework 4.5.2, so need to use the version 6.8.3 of MySql.Data.Entity. Now it works fine for me.
Today, I tried to using MySql in Abp sample project, but failed. I am guess the issue is caused by Abp.Zero.EntityFramework, can anyone know how to address it?
1 download sample project from ABP website
2 install MySql on windows, create a database named ‘sampledb’
<a class="postlink" href="https://dev.mysql.com/doc/refman/8.0/en/mysql-installer-gui.html">https://dev.mysql.com/doc/refman/8.0/en ... r-gui.html</a>
<a class="postlink" href="https://downloads.mysql.com/archives/installer/">https://downloads.mysql.com/archives/installer/</a>
3 Install MySql.Data.Entity in EntityFramwwork and Web Project
Install-Package MySql.Data.Entity -Version 6.9.9, it will install the dependency Mysql.Data also
4 Change web.config in Web Project
<entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>
</entityFramework>
<connectionStrings>
<add name="Default" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;port=3306;database=sampledb;uid=root;password=*** " />
</connectionStrings>
<a class="postlink" href="http://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html">http://dev.mysql.com/doc/connector-net/ ... ork60.html</a> 5 Run Update-Database –Verbos in Package Manager Console, errors in the console. you can check the error message below. I am sure the MySql.Data is installed in EntityFramework and Web project. And also I can see it in packages folder.
system.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at MySql.Data.Entity.MySqlEFConfiguration..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Data.Entity.Utilities.TypeExtensions.CreateInstance[T](Type type, Func2 exceptionFactory) at System.Data.Entity.Utilities.TypeExtensions.CreateInstance[T](Type type, Func
3 typeMessageFactory, Func2 exceptionFactory) at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.<.ctor>b__1() at System.Lazy
1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy
1.get_Value()
at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration()
at System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model)
at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
at Abp.Zero.EntityFramework.AbpZeroDbContext`3..ctor(String nameOrConnectionString) in D:\Halil\Github\module-zero\src\Abp.Zero.EntityFramework\Zero\EntityFramework\AbpZeroDbContext.cs:line 72
at HL.TSE.EntityFramework.TSEDbContext..ctor() in C:\E\MyPrograme\DoNet\HL.TSE\HL.TSE.EntityFramework\EntityFramework\TSEDbContext.cs:line 22
--- End of stack trace from previous location where exception was thrown ---
I am guess the issue is caused by Abp.Zero.EntityFramework, can anyone know how to address it?
This is not a question, it is a share. Today I download a sample project from ABP website, but cannot build it successfully. The build errors are in abp.d.ts, finally I found the typescript version in my local in 1.8, but the sample abp project using the version 2.1 for typescript. So I install the latest version of typescript , and it works. Share to you, maybe you encounter the same issue.
@wangxiaochen you can debug into XXX..Api.Controllers.AccountController.Authenticate to track what happened, and which statement is executed, the exception is thrown. Also, I am think 8080 port is so general and used by other service.
Thank you !
I download the sample project in website. And I can run it successful, but a question here. For the webapi service, the services address is <a class="postlink" href="http://localhost:8080/api/services/app/">http://localhost:8080/api/services/app/</a> like this. And for the login service in weB.MVCController, its address is <a class="postlink" href="http://localhost:8080/account/Login">http://localhost:8080/account/Login</a>. But I found there is webpi.AccountControl, what's the service address of it? I tried <a class="postlink" href="http://localhost:8080/api/services/account/Authenticate">http://localhost:8080/api/services/account/Authenticate</a>, it did not work. Could you let me know? Thanks!
Hi
I create a sample project MyTest in website, but I CANNOT run it If I change the platform from Any CPU TO X64. My computer is Win7 64 bit, and I use Visual Studio 2015 update 2 Please see my step 1 create a sample project named MyTest in website 2 change connection string and db 3 run it with Any CPU, it works fine 4 change Any CPU to x86, it works fine 5 Change Any CPU to x64, an error is returned - "Could not load file or assembly 'MyTst.Application' or one of its dependencies"
Do you have any advice for this issue? Since I have a component must run in x64, so this is important for me, look forward your feedback. Thanks!
The audit log is good, but I would like to log more information for an application service, I would like to user Logger to do it. But I would NOT like to add the following code “Logger.Debug("*****");” for each application service manually. So I would like to know if is there a way to log it like audit log – process it automatically. Or is there a way to extend audit log function?
Got it. Thanks your clarification!
Thanks, got it. yes, I have made validation on client side ,but to make sure application reliability, I make the validation on server side also. I think I can use CustomValidate to address this issue. Thanks again.