In the Windows Features control panel applet, under Internet Information Services → World Wide Web Services → Application Development Features, there are two options: ".NET Extensibility" and "ASP.NET".
What is the difference between these two options? If I'm developing simple ASP.NET web applications / services, is there any need for the .NET Extensibility option?
I Google'd the terms, and came up with this link:
http://forums.iis.net/t/1146942.aspx
This link confuses me, because the response (from a supposed Microsoft employee) says that to test for .NET Extensibility, you create a simple ASPX page, and try to load it. That seems (to ME) more like a test for the ASP.NET option.
Any clues?
In versions of IIS prior to 7.0, the ASP.NET pipeline was separate from the web server's request processing pipeline. The web server's functionality was usually extended via ISAPI filters and extensions.
However, in IIS 7.x they are more tightly integrated, which allows for the server to be extended using managed code, via the ASP.NET extensibility APIs. Two primary ways this can be done are via modules and handlers, which are quite similar to ISAPI filters and extensions respectively.
The APIs of interests are:
System.Web.IHttpModule
System.Web.IHttpHandler
System.Web.IHttpAsyncHandler.
You can read more about how to extend the server in the articles below.
http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis-7/
http://learn.iis.net/page.aspx/170/developing-a-module-using-net/
http://msdn.microsoft.com/en-us/magazine/cc164128.aspx#S4
This site talks about .Net extensibility in relation to IronPython: http://www.asp.net/learn/whitepapers/ironpython
You might want to review more info at this site: http://aspnetextensibility.com/
Assuming your developing asp.net sites in c# or vb.net then you will need the ASP.Net support. To sum up, it's probably one of those things you'll be able to define when you actually need the .Net Extensibility option installed.
However, if you really want to know: .Net Extensibility is an IIS 7 feature which brings the ability to extend IIS 7 via the runtime extensibility model into the core server product.
Building "regular" sites (whatever those are), don't worry about it. Needing to get down and dirty by modifying the pipeline through modules or handlers? Install it. Either way, you are still going to need the regular ASP.Net support installed.
With regards to what the MS guy said about the Hello World file.. Ignore that, he didn't read the full question...
Related
I need to allow some users to upload some plugin dll that would run on the server (based on asp.net core) as some custom script (I dont want to use javascript or any other languages to limit the api accessibility).
How can I keep the user dlls from accessing the .net APIs such as System.IO to avoid the potential security problems on my server?
.NET Core does not provide any code sandboxing, isolation, code security features like how previous versions of the .NET Framework did with AppDomains and trust settings. These features were found to be insecure and omitted from .NET Core from the get go.
However, if you still want to run code (.NET Core or not) from an external source there's several options.
Create your own DSL. This is what Salesforce has done with Apex. If the language gives your developers everything they need and limit what they can do, this is a solid option. JavaScript would be a great option as you can define what calls can be made into the .NET side if you use a .NET JavaScript interpreter and you wouldn't have to reinvent the wheel. Node.js would work but you would run into that it has a rich API for accessing "the outside world"
Use Docker. Docker containers are really isolated and can't directly touch the outside world without your permission. This is how the .NET example runs work. They can't do damage to the host machine unless you give them permission to do so.
Anytime you load code into your process you are opening the gates for them to do anything that your process can do.
I want to learn how to build websites using the Microsoft ASP.NET framework on a Mac running OS X 10.10.5. I will be following along with an online course that uses ASP.NET MVC 5. All of the tutorials I have read so far say to use Homebrew's aspnet/dnx repo to install ASP.NET. However, according to the GitHub page:
"This repository is obsolete and no longer used or maintained."
A link on the page redirects to .Net Core
So, my question is: how do I install ASP.NET MVC 5 on my Mac, not .NET Core?
Thanks!
If you want to start developing for .NET (including ASP.NET MVC and related technologies) on OSX, you'll need to look towards .NET Core. There are instructions there on how to install it and how to write code for it. There are good examples linked at the bottom of the page.
Please be aware that, as of this time, the related OSX technologies are not full released, so prepare for some hiccups along the way (though...it's getting better!).
You want to use https://www.microsoft.com/net/core#macos
Follow the examples here once you're set up: https://docs.asp.net/en/latest/getting-started.html
dnx is deprecated as mentioned on their GitHub page.
This repository is obsolete and no longer used or maintained.
Also, for what it's worth - dnx/dnvm were CLI tooling used to build/bootstrap .net applications. They were used during the beta/rc versions of what is now known as dotnet core. The new https://github.com/dotnet/cli has replaced dnx.
Nothing is better than using the OS with the full capabilities as Windows to work with ASP.NET or Windows Forms (really beautiful on Windows) as a student I've been trying to get this things on mac but is kind of difficult and as future engineer, if I have to get complex operations to do something, due, something is wrong, engineering solutions is to make the easiest possible solution and that one is using Windows. Less paint in the ass.
I have a smart device (Windows CE 2013) that just got the requirement to be controlled from a number of different devices, to do this, we decided to serve a web page from the device that allows it to be controlled.
I've also read that compact framework doesn't support ASP.NET so I'm intending to serve a static webpage that contains a javascript application that calls web services hosted on the device.
I also found this link explaining how to serve a SOAP Service in C++, but it seems old, and I'd prefer to do this in C# as it's my preffered language and I already have some code on it
I'm not quite happy with this solution, am I missing something? Can't I really do this in C#?
You could try this library for .NET https://github.com/ServiceStack/ServiceStack .
It is a free in case if you are using branch v3 form a github.
There's nothing built-in in the CF that provides web server capability. Windows CE has always shipped with an HTTPD server, but, honestly, it sucks and can't be integrated with managed code anyway.
We solved this problem long ago by creating our own IIS-like web server implementation (available commercially). You could do something similar as well - it's just a lot of Socket work. That trivializes the complexity of concurrent request handling and providing an IIS-like object model, but you get the idea. Basically you have to write the whole thing.
The main answer to this is to use Mongoose (or the MIT-licenced equivalent Civetweb). They are C webservers designed for just your task - an embedded web server.
They are really easy to implement, 1 C source file added to your project, give it an array of options, and you're done. See the examples. It has plenty of features and is fast, and small (40kb compiled!). They say it takes 5 minutes to get going with it, and they're right - I tend to use it to add webserver functionality for normal applications now.
I have an old MFC app written in Visual Studio 6. This will at some point be rewritten in C# .NET. However, before then I have to write a couple of new Windows services for the existing application. The others were written in ATL. What I would prefer to do is write these new services in C# .NET so that when the rest of the application is rewritten, these don't need to be.
Is it going to be possible to call the interfaces on the libraries hosted in a .NET windows service from the old application? If so, could you please explain how.
Absolutely. You're looking for a feature of .NET called COM-Interop.
http://msdn.microsoft.com/en-us/library/kew41ycz%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/magazine/cc163494.aspx
The second link has an ATL example.
EDIT:
Based on your feedback in the comments, let me expand on this...
Ah - you're right about the sample on that page.
The first link is really where you want to start for all the details. If you follow the links, you'll find this page:
"Exposing .NET Framework Components to COM"
http://msdn.microsoft.com/en-us/library/zsfww439%28v=vs.71%29.aspx
Essentially, it's just a matter of applying a series of attributes to your classes and properties, and then generating the appropriate registry entries on the client machine (which .NET has a tool to do - see: http://msdn.microsoft.com/en-us/library/bctyca52%28v=vs.71%29.aspx)
I've done this several times myself for .NET projects people needed to call from VC++ and/or VB6.
Some other links that might be of interest:
http://www.codeproject.com/KB/COM/nettocom.aspx <-- Perfect example of what you're trying to do.
http://www.codeproject.com/KB/COM/Universal_CCW.aspx
I've done this exact thing with an MFC-based C++ application in Visual Studio 2008 and a .NET-based C# Windows service.
First, if you have not created the C# Windows services yet, I've got a couple of tutorials for creating the basic framework. The first tutorial provides a step-by-step procedure for creating the service and writing events to an application-specific event log. The second tutorial shows how to modify the service to install and uninstall itself from the command line, which I find of great use.
Second, you need to decide how you are going to communicate between your MFC application and your Windows service. Any kind of inter-process communication (IPC) model will work - sockets, pipes, shared memory, WCF, etc. Since you are wanting to migrate to .NET anyway, I would recommend using Windows Communication Foundation (WCF), which is the way I've done it. Specifically, I chose the named pipe aspect of WCF for my communication method based on the chart shown here.
If you go down the WCF route, you'll benefit from the fact that the communication between application and service is .NET-based. Thus, when you move your application to .NET, the communication mechanism won't have to be rewritten. The trick in the meantime is getting your MFC application to use the WCF code. To do this, write the WCF client code in a .NET assembly using C#. Then, use a C++ dll to bridge the gap between your MFC code and the .NET assembly. I've got another tutorial with step-by-step instructions for how to do this.
Hope this helps.
I'm maintaining an application which currently is just a web service (built with WCF) and a database backend. The web service is built in layers with a linq-to-sql data access part with core functionality in an own assembly and on top of that the web service assembly which contains the WCF code. The core assembly also handles all business logic rules (very few actually).
The customer now wants a Web interface for the application instead of just accessing it through other applications which are consuming the web service. I'm quite lost on modern web application design, so I would like some advice on what architecture and frameworks to use for the web application. The web application will be using the same core assembly with business rules and the linq-to-sql data access layer as the web service.
Some concepts I've thought about are:
ASP.NET MVC (or MVC-2)
Webforms
AJAX controls - possibly leting the AJAX controls access the existing web service through JSON.
Are there any more concepts I should look into? Which one is the best for a fresh project?
The development tools are Visual Studio 2008 Team Edition for Developers targeting .NET 3.5. An upgrade to Visual Studio 2010 Premium (or maybe even Ultimate) is possible if it gives any benefits.
Definitely dig into ASP.NET MVC2.
All of our projects are now being developed using ASP.NET MVC2. It's not just highly scalable. It's highly testable as well. Which leads to way better maintainable apps in the long term.
WebForms vs. MVC2 points - (speaking out of experience):
Scalability:
In our company we had a lot of applications using WebForms which then were updated and changed by us as needed by our customers.
I think your customer will be requesting more changes on the application in near future. Making calls to other services, and maybe you'll have to rework parts of the final product to match their wishes.
And with the upcoming Cloud Computing and the Windows Azure platform you'll probably need to keep up with your code.
ASP.NET MVC absolutely supports the concept of being able to scale up your application any time you want.
I remember one of our customers walking up on me asking me for an extension for their app (they have a member management system) and the feature would contain something like a link to export the current view as a csv file so they could do office stuff with it (mostly serial letters).
It wasn't really a big problem setting that feature up. (took around 2 hours including writing tests) - let's go to tests:
Testability:
Using WebForms we didn't really have much interest writing tests because it was a pure pain to do so.
I remember writing some tests to have at least some proofs but let's drop that topic.. (:p)
We had tests for our custom classes but we couldn't really test all the EventHandlers within the WebForms.
Our CodeBase is way cleaner and saver to use thanks to this testable environment. I just check out some of the code, modify it, run all the tests and: Oh, it broke on strange behavior! - Let's fix that again. Earlier, I remember sitting with my co-worker debugging and trying to find those bugs for hours.
With ASP.NET MVC2 we are now lacking tests!
We ask all kinds of people (even the non-Web ones) to provide test-cases we could feed into our TestSuite.
And yeah, there are some AJAX-Controls too:
AJAXability:
You asked about AJAX Controls and in conjunction with ASP.NET MVC I highly recommend you to check out Telerik ASP.NET MVC UI Controls.
If that isn't something for you, we also make extensive use of jQuery and jQuery UI
With ASP.NET MVC and the HTML Views, those libraries aren't just a pleasure to use, they just look amazingly beautiful.
There is no random-html-tag-id-value autogeneration anymore!
But what I like most is: You can finally really re-use your code again.
There is so much more to those frameworks than just that, there is the T4 templating system. Auto-Scaffolding for your ViewModels / DomainModels with the Html.EditorFor() method and of course there is a great and easy way to use the IoC and DI paradigms.
Assuming that you have asked the question with mostly .NET Framework related tags, you'll probably stick with it.
Just to keep the post complete, there are also other frameworks that are just as good (or even better):
Ruby on Rails
Django
CakePHP
And many many more!
There's also DynamicData which may be appropriate if you need simple CRUD access to your data.
The Web Service Software Factory (WSSF) might come in handy in your situation.
This will allow you to define your contracts (XML entity returned (if XML you choose), etc.) while designing the server/client communication using WCF (or standard Web Service communication protocol).
WSSF favors either ASP.NET MVC or ASP.NET MVP. A simple example of the MVP architecture is shown here, plus this article.
As for me, I often come with a hybrid-like architecture using a bit of both MVC and MVP, as both have different strong points which combined together fill each other's improvement points.
I'd also recommend looking into Silverlight.
http://www.silverlight.net/learn/
Just my opinion to use MVC on Client sites and WebForms inside administration pages(site)