I have a Web API project (4.5) that has all the DTO objects stored in a separate project for simplicity. I was wondering if there is anyway to link from the Web API help page to these class libraries so that my end users can not only see what they need to send but so that they can see the XML comments on those objects specifying what each property of the object does/means.
I suppose you are talking on "WCF Web API Test Client",
AFAIK it uses Microsoft.AspNet.WebApi.WebHost.dll provided by Microsoft. The sources are not available but if it is not obfuscated you can change it after ILSPY.
Beside this you can't decorate it, normally you just redirect the page from global.asax.
Another option : Maybe you should write your own. But you will have much work with attribute reading and reflection :) Maybe you should start a project in CodePlex & git.
Related
I want to create a custom registration/authentication module for DNN site. In the past I made a web application with a registration form, but then I used Entity Framework and IdentityUser class, I need to use DAL2 now. Is there a similar way to do this? Thank you
For this you will want to create an AuthenticationProvider. It is a special project type and will use the DNN API for any data elements.
The documentation on this model is quite light, but you could review the core authentication provider. There are also third party ones available with source that could be used for education.
This article is old, but looks to still be correct. https://www.dnnsoftware.com/community-blog/cid/134678/dotnetnuke-tips-and-tricks-12-creating-your-own-authentication-provider
i'm working on a webapplication written in C# using the ASP.NET MVC framework.
I want to allow my clients to write their own plugins for the web application. Each client get it's own database.
I got some ideas how to do this:
I will provide an interface which allows the user to upload his assembly dll. This will store the dll in a specific plugins-folder for the client.
I will provide some C# Interfaces and Attributes for Class and Method annotations.
The business logic of the server will check each plugin and search for classes and methods with these attributes or interface implementations to override or alter it's default behavior on certain points.
For performance, I'll implement some form of caching that gets invalidated every time a new plugin is uploaded.
Now my question:
How can i allow the user to write a plugin? I mean how to provide some kind of SDK for this? The user primary needs the C# interfaces and Annotations but the developer also want's to test the plugin before uploading it to the production server. Can i pack my webapplication in some kind of DLL which could be loaded by the developer for testing purposes but not read the source code? Or is there any other way of doing this?
Thank you for any info on this!
You should take a look at MEF (Managed Extensibility Framework) this is a framework Microsoft created to enable applications for plugins.
In short: You create a library with contracts (interfaces). You give that library to your customers and tell them to write plugins based on those interfaces.
Then you tell your application that when it needs IPlugin it needs to search the plugin folder for an implementation of IPlugin and use that.
Some research urls:
https://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx
http://mikehadlow.blogspot.nl/2010/10/experimental-aspnet-mvc-add-ins.html
https://blogs.msdn.microsoft.com/brada/2008/09/29/simple-introduction-to-extensible-applications-with-the-managed-extensions-framework/
http://blog.maartenballiauw.be/post/2009/04/21/ASPNET-MVC-and-the-Managed-Extensibility-Framework-%28MEF%29.aspx
i have a best practice question. I'm working on an Vb.net Webproject in Visual Studio. We are creating some modules that are defined in its own Class Library Project Folders. I want to bundle all files for this module within the project folder ... that include the WebServices.
I tried to define a WebService as in this HowTo described (http://www.dotnetwire.com/Articles/Class_Library_Project.asp) but i can't reach the WebService (404). Is this approach obsolete with IIS 7.5 or higher cause i found some postings on codeproject where other users have similar problems.
Is there a better way to "outsource" a webservice to its own library since when the upper HowTo was written ?
Greetings and thx in advance for help.
M. Lang
I think the general trend nowadays is to migrate away from the old .asmx services and toward REST. If you're using .NET the standard has been more and more ASP.NET Web API. Having said that, I develop my REST services in completely different solutions.
is it possible to extend an existing ASP.Net MVC Website, written in C#, with IronPython. I want to make our website customizable. So my plan was, i can write additional controller and models in IronPython and views with "cshthml" and then load it dynamically in the website.
I've searched a lot and found some examples, but they always work with ASP.Net Web Forms.
Thank you!
These two pages found on Google help explain it in depth.
http://www.tikalk.com/net/write-aspnet-mvc-using-ironpython-resources
http://forums.asp.net/t/1527861.aspx?how+to+start+ironpython+in+asp+net
You will need to add a reference to the DLL in your references section of the project. Other than that, things should work as normal. I use IronPython in my business website without any issues whatsoever. If you get it running and find that there is a piece of code you are having trouble with, please don't hesitate to comment.
Does anyone know how to do this? I built a backend c# class in asp.net but want to access these same classes without recreating them in silverlight. Is this a possibility?
You can reuse the cs files by adding them to your project AS LINK. Right click in your project and select Add Existing...Browse to your file and in the Open Button, use the pulldown arrow on the right to select Add As Link. You will see the file added to your project with an icon that with the little Windows Shortcut icon overlayed on it.
Just remember - the ASP.Net runs on the .Net runtime. Silverlight runs on the CoreCLR (Silverlight runtime.) Not everything that compiles in oone will compile in the other...
To separate things a little bit, #if directives can help, you can also use Partial Classes and partial methods (to add content that only runs on the server or on the client.)
RIA Services is definitely the way to go for sharing code between ASP.Net and Silverlight.
As well as the previously mentioned generation of domain service models, it also lets you share individual files between the web-app and Silverlight by simply inserting "shared" in to the filenames. e.g. "MyClass.shared.cs".
RIA services does not take long to get to terms with (and there are good tutorials about). Try this one.
Well, ASP.NET itself isn't going to work (ditto many of the full libraries), but I'm assuming you just mean you local domain model etc.
IIRC you can try to simply reference it, but it may well generate a warning message. Of course you need to be exceptionally careful not to use anything that the other platform doesn't support...
IMO, the better option here is to create a second csproj that includes the same .cs files (or cheat with a wildcard/deep include). And build both. Same C#, different dll/platform.
Is isn't uncommon to find that you need a very small usage of #if directives, too.
WCF RIA Services may help you solve your problem. Silverlight does not use the same runtime as ASP.Net does and you cannot directly share assemblies containing model classes on the client and the server side. To solve that WCF RIA Services will transparently generate classes on the client side based on model classes on the server side. Obviously WCF RIA Services will also allow you to create, read, update and delete objects of these classes using a web service.
MSDN has more specific information about WCF RIA Services Client Code Generation.