I build a web api service for mobile and web, it works fine on azure, but soon I realised that Nuget Manager has NOT installed Web Api package "Microsoft.AspNet.WebApi".
I know that Core Controller combines MVC and Web Api functions for DNX Core, it can work without web api package. But DNX 4.5.1 also does not contain Web Api package. How will my app work on this platform (DNX 4.5.1)?
Thank you!
What about this Microsoft ASP.NET Web API 2.2 5.2.3 ?
This package contains everything you need to host ASP.NET Web API on
IIS. ASP.NET Web API is a framework that makes it easy to build HTTP
services that reach a broad range of clients, including browsers and
mobile devices. ASP.NET Web API is an ideal platform for building
RESTful applications on the .NET Framework.
Here is the link : Microsoft ASP.NET Web API 2.2 5.2.3
It looks like you are using ASP.NET 5 and MVC 6. In this case you don't need Microsoft.AspNet.WebApi (for MVC 4) nor Microsoft.AspNet.WebApi 2 (for MVC 5)
There is no more separate package for Web API in ASP.NET Core.
There is new combined package called Microsoft.AspNet.Mvc.Core (6.0.0-rc1-final)
Everything will work on both DNX 451 and DNX CORE
Related
I'm a .NET developer, I want to develop an ASP.NET Web API that will be deployed on ubuntu and will be called by a J2EE application.
is that what I would have deploying problems on ubuntu?
do you think that ASP.NET Web API is a good choice? or should I develop my API in ASP.NET CORE?
thanks.
You should choose Asp.Net Core over Asp.Net .
You can not deploy asp.net web api application to ubuntu, but you can with asp.net core web api.
Its better to go for asp.net core for linux platform. You can deploy this with the help of docker as well.
I can find similar questions, but those answer is not clear or no answer (all answered now) that make me confuse .
Similar questions 1
Similar questions 2
Now Visual Studio has 3 Web Project template :
ASP.NET Web Application (.NET Framework) <-- old
ASP.NET Core Web Application (.NET Core) <-- new
ASP.NET Core Web Application (.NET Framework) <-- new
I know the different between .NET Core and .NET Framework.
.Net Core - can cross platform(Windows, OS X, Linux)
.NET Framework - Windows Only
Then, the problem:
If we can use .Net Core in cross platform include Windows,
Why there still need ASP.NET Core Web Application(.NET Framework)(new) ?
If only work on Windows ,
Why don't just use ASP.NET Web Application (.NET Framework)(old)? which much mature and more support.
What is the purpose/usage of ASP.NET Core Web Application (.NET Framework)(new)??
.NET Core does not have all the APIs available in .NET Framework. As a result when running on Windows you may want to target full .NET Framework instead of .NET Core in your Asp.NET Core application.
Asp.NET 4.x is still supported and it's perfectly fine to create new applications using Asp.NET 4.x.
However, the vast majority of innovation goes to Asp.NET Core. Asp.NET Core is also open source so you can actually see the code you are running, debug the code you are running and even contribute back your fixes or new features. Finally, Asp.NET Core is also much more lightweight (everything is a NuGet package and you only include what you need, not coupled to IIS - runs out-of-proces when using IIS) and much faster than ASP.NET.
I am currently checking out asp.net vnext MVC6 in Visual Studio 2015 Preview. I'm pretty new to asp.net in general, but within my company we are going to move towards creating a web api using asp.net for accessing data on our server (currently we only support wcf communication with our own silverlight application). This is the reason I am checking out the new functionalities of MVC 6 to judge whether we should wait before starting our development and use MVC 6 when it is finally released or start development now and create a Web API 2 project.
Anyway, I am looking into auto documenting the web api, which is already integrated into the Visual Studio template for a WebApi 2 project by use of Microsoft.AspNet.WebApi.HelpPage.
Now for my question, is something like this available for MVC 6 aswell? I can import the same package in my project.json in my ASP.NET vNext / MVC6 (whatever you want to call it) project but i can't do app.UseHelpPage(); in my Startup.cs file.
I suspect this is not (yet) integrated in the current release yet. If not, is there anything known about integration of this feature once ASP.NET vNext eventually hits the shelves?
Probably this feature is not available in MVC 6 yet, but you could try Swagger.
Swagger basically is a framework for describing, consuming, and visualizing RESTful APIs.
The nice thing about Swashbuckle that it has no dependency on ASP.NET MVC, so there is no need to include any MVC Nuget packages in order to enable API documentation, as well Swashbuckle contains an embedded version of swagger-ui which will automatically serve up once Swashbuckle is installed.
Source: http://bitoftech.net/2014/08/25/asp-net-web-api-documentation-using-swagger/
I have a website running aspx pages, under asp.net4.0.
I also have some DevExpress controls, that I purchased 4 years ago.
I now want to add an API to the web application, however I understand that needs .net4.5 to be running.
The DevExpress controls don't work under 4.5 - so I would need to renew them at considerable cost.
it possible, after installing .net4.5, for my site to continue to
use .net4 - and not the new 4.5? so that I can have the site
operate under 4.0, and the API under 4.5?
Or is it possible to have the API (using the Entity Framework)
run under .net 4.0
Thank you,
Mark
You can use both web-api and entity framework without installing .net4.5.
You can add web-api to an existing project by installing the nuget package "Microsoft.AspNet.WebApi" (release candidate)
Yes, if you put your Web API in a separate project, you can make it 4.5 and the other projects you have that make up the site can be 4.0. You choose which framework you target when you build your projects:
Right click on project > Application > Target framework dropdown
You can add Web API to any .NET application that uses at least .NET 4.0. Web API doesn't require .NET 4.5. It can be a Web Forms project, MVC project, empty project, console app, WPF app, Metro app etc etc - as long as .NET version is at least 4.0.
But the simplest solution in your case seems to be to just keep everything under 4.0.
You better recreate the web API project using final version of the WepAPI assembly
Tutorial:
http://david.gardiner.net.au/2015/08/aspnet-web-api-for-net-framework-4-in.html
Microsoft is encouraging developers to use asp.net web api for creating Restful services. I have done some googling
http://www.matlus.com/asp-net-web-api-with-webforms/
it seems to me that i can use it with .net 4.5 but not with 4.0. In .net 4.0 what are my options for creating Restful service. is it only wcf web api or something else that should be used?
You can create asp.net web api service without installing .net 4.5, you only need to install asp.net mvc 4 for VS2010 and normally use for .net 4.0. Alternative, you can use WCF service or asp.net mvc controllers for REST architecture, see this example with asp.net mvc
A small mistake of yours, there is no WCF Web Api anymore. That was the original name, then it was renamed ASP.NET Web Api.
You can use it with .NET 4.0. Just install ASP.NET MVC 4 and you get Web Api. But it's still in Beta...