Reputation: 1425
I would like to use Windows Forms with a WCF service and leverage the pre-built authentication of asp.net by using aspNetCompatibilityEnabled = true in the WCF service.
Is there any module or pre-built assemblies that can add ASP.NET functionality to a Windows Forms application? As far as I understand, this functionality isn't built into Windows Forms and can't be leveraged.
Upvotes: 2
Views: 382
Reputation: 6628
If you do insist on hosting the http runtime in a windows forms appliciation, the easiest way is to get the source code of cassini for .net 3.5 . Really straightforward to use. It is a winforms application already. Cassini is the development server for Visual Studio.
I have personally tested it on a website with membership set on and works perfectly. If you need it to process requests other than from localhost though, you need to change IPAddress.Loopback to IPAddress.Any in Server.cs, as pointed out in the comments.
Upvotes: 0
Reputation: 6628
While it is certainly possible host the asp.net runtime in a desktop application, that would involve a bit of plumbing you will need to do manually. In case you want to use the membership provider, you'll also have to handle the certificates.
I would recommend you to either :
Upvotes: 1
Reputation: 22733
This is all possible as I've worked on a solution with the scenario that you've described. It's all down to configuration. My recommendation would be to follow this CodePlex Checklist for that scenario. It contains a step by step guide for configuring your application. It shows you how to set up your user store (database), client authentication, setup IIS, security etc.
Upvotes: 0
Reputation: 754438
I am not aware of anything that's available out of the box, for this scenario.
The whole ASP.NET membership and role system is based on a known SQL Server database called "aspnetdb", which features some tables and stored procedures for the most commonly required functions - so there's really nothing stopping you from building a Winforms based front-end to that underlying database.
I don't know if there's any official documentation on the ASP.NET membership tables and routines - but as far as I recall, they're all fairly straightforward to reengineer and use - so go ahead and build that system of yours!
If you Google or Bing for it, you can even find quite a few articles and blog post from folks who've done that themselves:
Upvotes: 2