How to inject Mock Request Headers when using Apnet WebForms? - webforms

Is there any way to inject 'Mock' Request Headers for testing purposes when using Aspnet WebForms? I'm able to do this in my .NET CORE Projects using Middleware, but now I'd like to help a customer do the same thing with their Webforms project. I haven't worked with WebForms in many years, and I haven't found much online about this so far. I'm just looking for a starting point so I can investigate further. Thanks

Found Something here - will update later with my solution:
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/httpprotocol/customheaders/

Related

Where are IApplicationServices registered in ABP framework?

I know that services that implement IApplicationService are automatically registered but I cannot for the life of me find out where in the framework this happens. I have spent the last day searching through the ABP solution trying to understand how this works (in the context of dynamic API generation), so I can extend the functionality in a project I am working on, but have gotten no where so far. I appreciate any help I can get in sending me in the right direction.
For Dynamic WebApi controllers, a single controller is generated in Build method of ApiControllerBuilder class. You can check it here https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/Controllers/Dynamic/Builders/ApiControllerBuilder.cs#L153.
I hope this helps.

ASP.NET Core 1.1 (Dynamic Controller Loading)

I've done this before with WCF (using VirtualPathProvider), and again later with WebAPI2 (using DefaultHttpControllerSelector), to implement a plugin system for enterprise web applications that supports live updating. so I'm hoping their is a way to do this in ASP.NET Core 1.1, but I just haven't found the appropriate process yet.
What I would like to achieve is the following basic scenario. If an request fails to match an existing controller route, use the controller name provided by the request to probe a folder for a matching controller assembly. If a match is found load the assembly into the domain, and continue to process the request, otherwise just return a 404.
So far all my research has come up empty handed... but I'm completely new to .NET Core so there is still a lot I have to learn. While I continue my research, if anyone can provide any insight, I would greatly appreciate it.

ASP.NET Web-API Help-API Generator?

I am wondering if anyone can point me to which Web-Api Help Generator I should use.
I found this post but it is already a year old and seems to be outdated.
I think ApiExplorer is now Web API Help.
The post also talks about Swagger which from some demos looks a lot nicer and seems like you can do like post requests and such but I am unsure if it still in development as it's been like a year since the last update.
Anyone have any experience with either of them?
The "Web API Help Page" package (Microsoft.AspNet.WebApi.HelpPage) is built on top of ApiExplorer.
Web API Help Page generates documentation pages and adds them to your project.
ApiExplorer gives you a lower-level API that just gives you the API descriptions, which you can use to create documentation.
See: http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages
I haven't used Swagger. From the readme, it's also built on top of ApiExplorer.

ASP.Net MVC3 user authentication tutorials

I'm currently working as a developer on a website, and it's more or less my first time doing any sort of web development. We're currently at a stage that we need to do user authentication, but I have absolutely no idea how I can accomplish this.
To that end I've tried to do some googling and searching on SO, but my google-fu is currently failing me.
Are there any tutorials that can take me from knowing nothing about authentication, to being to set up some secure authentication on my website?
We're developing this under MVC3 with Razor view engine, if it helps at all.
I would say here is a good starting point. The fact that it's MVC3 isn't really going to change anything (i.e., the Razor view engine doesn't change anything about authentication in MVC)
Take a look at the ASP.NET MVC Music Store example application, specifically Part 7.
what ErOx posted + here is sample implementation of custom MembershipProvider

Spring.NET with MVC3 (Razor)

I'm experimenting with ASP.NET MVC3 Razor and I'm fairly impressed. This is the way we'll go.
We use Spring.NET for dependency injection in our framework and I wonder, if it is possible to use it for MVC3 projects as well?
The documentation of Spring.NET is only talking about MVC2, but I guess there will be MVC3 support in future release. Nonetheless I was trying to get it work though. With no success so far.
So my question is, if someone else found a way or workaround or trick to do dependency injection in MVC3 using Spring.NET and if so, how?
I know this is a very general question, but even a honest "sorry this is definitely not possible" or "it should work without any modifications" would help me a lot.
Thanks in advance,
Jan
Yes, even though the the latest Spring.NET release (1.3.1) has explicit support for MVC2, it can also be (pretty easily) used to support MVC3. The IDependencyResolver interface introduced with MVC3 makes IoC integration significantly more straightforward than it had been in the past (offering just one single interception/pluggability point for type resolution where previously there had been multiple places you needed to intercept type resolution calls).
See blog posts like this one: http://blog.alexkyprianou.com/2011/03/07/using-spring-net-with-mvc-3/ for more information and suggestions on how you might go about doing this (its really quite simple compared to the effort/complexity of doing so with MVC1 and MVC2.
It should work without modifications.
After some more investigation and help of colleages I found out, that Spring.NET works with MVC3 - at least as far as I can see it now. My orignal problem was a misformatted xml-file for my injection objects (I didn't post the code in the question).
Still there seem to be issues with object scopes. The scope request doesn't seem to work, since all my objects are still singletons and once created, can not handle more than one request.
I tried to add the well-known attribute singleton="false" and it worked somehow, so my objects will now be created on every request. Good!
However I found out, that Spring.NET's example Spring.MvcQuickStart.2010 also uses the singleton attribute with value false, so probably this is the correct way (and true by default).
I don't know yet, how to handle the session scope, but at least my web application works for requests (singleton="false") and application-wide (no singleton attribute) with Spring.NET and MVC3.
Best,
Jan

Resources