Westwind.Globalization icon indicating copy to clipboard operation
Westwind.Globalization copied to clipboard

Not working with Asp.Net Core 3.0

Open lvmajor opened this issue 5 years ago • 8 comments

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 avatar Nov 01 '19 18:11 lvmajor

According to logs, it fails in LocalizationAdministrationController.GetLocalizationInfo

lvmajor avatar Nov 01 '19 19:11 lvmajor

Same for me in Asp.Net Core 3.0

AmrAlsawy avatar Nov 05 '19 09:11 AmrAlsawy

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.

gunduzemreozer avatar Nov 07 '19 11:11 gunduzemreozer

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

lvmajor avatar Nov 07 '19 20:11 lvmajor

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.

gunduzemreozer avatar Nov 07 '19 20:11 gunduzemreozer

@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.

lvmajor avatar Nov 07 '19 21:11 lvmajor

@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.

gunduzemreozer avatar Nov 09 '19 09:11 gunduzemreozer

@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 😉

lvmajor avatar Nov 09 '19 13:11 lvmajor