Great tutorial how to make ASP.NET Core MVC routing working in Service Fabric. Even better would be if this would be already part of the VS 2017 Service Fabric project template.
@clouddeveloperio7 жыл бұрын
Thanks for watching and glad it helped you. I think the main reason why they don't include it in the project template is because not everyone might want to use the Application Gateway feature of Service Fabric and this issue is really only showing up when you try to host non-server based code such as javascript, css, images, etc... When you try to access web api type of resources through the Application gateway then everything works. I actually think that it would better if the Service Fabric team enhances their Application Gateway implementation to support better content rewriting and then this would not be needed. I have already made a recommendation to them about it so let see how it goes.
@clouddeveloperio7 жыл бұрын
Michal, I noticed you posted another comment but for some odd reason it is not showing up and I wanted to answer your question. I think the reason for the routing issue that you are seeing is due to an enhanced version of the code that I didn't get a chance to record specifically in the Startup.cs file in the SFContacts.UI project that I have. It deals with adding some header forwarding code that helps when requests are sent through a reverse proxy type of middleware that the Application Gateway is. I have uploaded the code into my github repository for this channel that you can find here: github.com/clouddeveloperio/SFContacts Look specifically at the Startup.cs file inside of the Configure method. You will notice that I am building a variable called forwardedHeaderOptions and later using it in the method to tell the Application Gateway to forward the headers to the target server. Hopefully that addresses you issue and you can get the application working.
@itwolves7 жыл бұрын
Thank you for point this. I didn't realize this. I deleted my comment, because I thought routing problem was due to your global route config change. That wasn't the case. My problem was, that generated AccountController has RouteAttribute defined on class level, that was overriding your global route. Removal of RouteAttribute fixed my problem.
@letsworksimple2 жыл бұрын
Does the mapped route "ApplicationGatewayDefault" get used because it's just a route or does it have a specific name that Service Fabric recognise and then use?