RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
543 stars 135 forks source link

Not working with Asp.Net Core 3.0 #181

Open lvmajor opened 5 years ago

lvmajor commented 5 years ago

As the title says, I migrated to asp.net core 3.0, but I get a 500 Internal unhandled error when trying to access the LocalizationAdmin/Index.html page.

Would you have an idea of what could be the culprit here?

I saw and tried the propsed solution in issue #149 but it did not fix my issue.

lvmajor commented 5 years ago

According to logs, it fails in LocalizationAdministrationController.GetLocalizationInfo

AmrAlsawy commented 5 years ago

Same for me in Asp.Net Core 3.0

gunduzemreozer commented 5 years ago

Same for me in Asp.Net Core 3.0 project. I research source codes a little. I think the problem is related with json serializer namespace changing in core 3.0 version. I hope that the problem will be solved asap. Thanks for sharing.

lvmajor commented 5 years ago

I managed to get a more specific error by manually copying the repo and using that in my project instead, it seems to be related to the fact that Json effectively isn't included now with asp.net core 3.0 applications.

Also, when trying to import it (Microsoft.AspNetCore.Mvc.NewtonsoftJson), it has other errors as ths package is not compatible with .Net Standard 2.0 (nor .Net Standard 2.1), it requires absolutely .netcoreapp3.0. The exact error is because of the missing definition for JsonResult as seen in this capture image

gunduzemreozer commented 5 years ago

Yes, I did same things :) Unfortunately, I couldn't solve the problem. Firstly I tried to override this Json methods in ControllerBase class of AspNetCore, unfortunately it took a lot of time and I stopped. The exact solution convert the application to .netcoreapp3.0 as you said.

lvmajor commented 5 years ago

@gunduzemreozer Just submitted a PR that fixes the issue for me and should also do so for you. As @RickStrahl does not seem super active currently (not blaming here, just noting 😉 ). I would advise you to also pull the project locally and reference it in your app until an official fix is pulled in this repo and pushed to Nuget.

gunduzemreozer commented 5 years ago

@os1r1s110 thank you so much for your help :) You opened up my horizon by conditinal package include :) And also read a lot of sources for packaging. I applied your code changing and uploaded to nuget as Westwind.Globalization.AspNetCore3. I think this will not be a problem for @RickStrahl. I used nuget.org for the first time. I didn't change Author and other infos of package. I will delist package when @RickStrahl publishes a new package.

Thank you so much again.

lvmajor commented 5 years ago

@gunduzemreozer great to hear. I was hoping that the fix would be merged in a timely manner so I didn't take the time to publish a new fork on Nuget but its great to see someone did! I will certainly reference your package until the official one is updated. Thanks for this! I'm sure it will help others too.

On my side I wrote an email to Rick hoping he would get it as I thought maybe he didn't receive notifications for the project by Github directly, but he may be away for whatever reason and this is fine. Glad we could find a solution to the problem and provide a fix (even if temporary) for others that will certainly face the same issue 😉