Need a special offer?Find out if your project fits.
+

CORS issue with Accelerator in ASP.NET Core

Answered
Matt Reid asked on March 18, 2022

Hi, 
The link from the thread is no longer working.  I have the dll imported through nuget and have fashioned an implementation that would appear to work as an API (apart from what is manifesting as a cors issue, despite the cors headers being set correctly), but can you point me at the latest template for implementing in asp.net core as I would like to see how your implementation differs.  The link from the thread is no longer working, so does that mean that the code has already been released?  The proxy accelerator is working fine with analysis services, but the call to the accelerator endpoint when wrapping the dll is causing a cors header issue to be thrown.  I suspect it may be something subtle to do with Windows Authentication, but any advice or additional material would be much appreciated.
Many thanks,
Matt

Ian Sadovy created this ticket from #44820

6 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 18, 2022

Hi, Matt!

Thank you for writing to us.

Flexmonster Accelerator for ASP.NET Core was an experimental project, and it wasn't released. Currently, the Accelerator DLL requires .NET Framework.
Could you please share your project with ASP.NET Core integration? Our team will take a look at it and try to find some recommendations. 

We are looking forwards to hearing from you.

Best regards,
Maksym

Public
Matt Reid March 21, 2022

Thanks Maksym, I've attached some stub code so you can see the approach being taken.  Hopefully it's just a small tweak that is needed as the standalone proxy accelerator works fine.  The config for the standalone proxy is using windows authentication and allowing same site origination by specifying localhost and the port name in the ALLOW_ORIGIN setting.  
The specific error that is occurring with the code provided is that a CORS issue is being triggered, but this may be a false positive and related to another underlying issue.  Let me know what your team can discern and what advice you can give as it would be more flexible to run this as an API.
Many thanks,
Matt

Attachments:
FlexMonsterCopy.zip

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 21, 2022

Hi, Matt!

Thank you for providing the code.

While our team is working on your case, could you please provide us with the errors logged in the browser console and the error displayed on our component's error pop-up. This would greatly help us in understanding the issue.

Our team is looking forward to your reply.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 22, 2022

Hi, Matt!

Hope you are doing well.

The cause of the issue is probably not related to CORS. Flexmonster Accelerator DLL uses Microsoft .NET Framework, which is partly incompatible with .NET Core. As a result, Flexmonster.Accelerator.Controllers.FlexmonsterProxyController endpoints can't be accessed from AcceleratorController.cs.

As a workaround, we recommend installing Flexmonster Accelerator as a Windows Service. With this approach, the Accelerator is running on background separately from your project. As a benefit of Referencing the Accelerator as a Windows Service, the configurations can be comfortably done in Flexmonster Accelerator Manager desktop application.

Please let us know if such an approach would work for your case. Looking forward to your response.

Best Regards,
Maksym

Public
Matt Reid March 22, 2022

Thanks Maksym, there's not actually a need for the API to be written in core, it was just force of habit on my part.  I'll rework it as a .Net 4.8 implementation and let you know the results.  The accelerator as a service functionality is working perfectly.  I just wanted to complete this last part to show all aspects of the product working and how they could be leveraged.
Will update with the results soon.
Many thanks,
Matt

Public
Maksym Diachenko Maksym Diachenko Flexmonster March 24, 2022

Hi, Matt!

Thank you for your reply.
Feel free to contact us if further assistance is needed.
We are looking forward to hearing from you.

Best Regards,
Maksym

Please login or Register to Submit Answer