ASP .Net MVC/WebApi with Angular 4/5 Visual Studio Template - c#

I'm using Visual Studio 2017 Community Edition and looking for an Angular with Web Api 2.0 (or MVC with Web Api) Template but not able to find one. When I try to google I get only links to Asp .Net Core related topics, no mention of identical template for older versions of ASP .Net. By older I mean any other than Core.
When I try to change the version of .Net to .Net Framework I still see only .Net Core templates:
Only available ASP .Net versions are Core.
There exists a template for single page application but it does not create an angular application:
If to look online, there is a template for Angular2 though:
But:
It is not an official microsoft template
I will need to upgrade the Angular version
It has no generated api controllers with authorization
No OWIN support
No file nesting for component files in solution explorer
All links to documentation or git hub are broken and response with 404
It's a nice and in some cases usefull template but still a lot of thing that would be nice to have in a template I will need to do manually, basically from scratch. Does there exist some powerful and rich template for Angular5 and Web Api 2.0 like there is for .NET Core?

Related

GraphQL support for ASP.NET WebAPI

Is there support for GraphQL and classic dotnet i.e ASP.NET WebAPI and not dot net core.I searched that on internet but did not find any useful resource.
We have exsisting ASP.NET WebAPI where we need to select and update few columns based on request received to API.so in that case we can use GraphQL. But I did not find any resources related to it.Everywhere is dotnet core apps.
If I recall correct, one of most popular lib GraphQL.Net under .Net stack, supports .Net standart 2.0 which means you can build and use it not only under .Net core (target framework should be at least from v4.6.2). At least I did it in one of project (not .net core one) successfully.

Not able to start project as asp.net Core (Razor App)

I have installed VS 2017 community edition and i am trying to create ASp.net Core 2.0 (Razor Page) but i am not getting that template when i create the project as show in this tutorial
What i get is show in below image
I am new to .Net Core and want to start learning .Net Core.
ASP.NET Core with Razor Pages is the third option in your screenshot:
However, unless you will create extremely simple web applications, you should skip it and go to the full ASP.NET MVC (fourth option). While Razor Pages is very new (only some months old), MVC has been pretty much the same for years, and allows for much more development.

.NET Core 2.0 and Aurelia

Here's my story: I created a solution in VS2017 which contains 3 projects: .NET Core 2.0 dll to store my models, WebAPI (which uses EF Core 2.0 code first) and blank Web Application. In the blank project I would like to create a frontend Aurelia app. So, I did 'au new --here' on that project, selected TypeScript as my transpiler. Now, I have a solution with 3 projects which doesn't build because of:
Error TS5055 Build:Cannot write file 'XX/karma.conf.js' because it would overwrite input file.
I updated TypeScript to 2.3 by adding a proper entry to .csproj but still cannot compile my solution in VS2017.
My question is: how to add an Aurelia project to .NET Core 2.0 solution and get "au run --watch" works for it? I followed this post: http://mobilemancer.com/2016/10/19/aurelia-spa-typescript-dotnet-core/ but it seems not to consider all possible scenarios.
Please help me get started with .NET Core 2.0 Aurelia + WebAPI as I've been struggling with that for a couple of days.
You can look at the code from Aurelia-Typescript-Skeleton from GitHub https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript-aspnetcore
They have created asp.net core application and basic structure for aurelia and typescript.
You can install SPA Templates from ASP.NET core 2.0 with CLI command dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
There you can find reach set of templates to start with ASP.NET core 2.0

What is the difference between creating a project ASP.NET Core (.NET Core) and ASP.NET Core (.NET Framework)

I don't see clearly the main difference between the last two project types, actually which sense have the last one? .NET Core and .NET Framework?
The difference is whether you will be targeting the .Net Core Framework or the Full .Net Framework. And this difference shows up for example in the project.json file.
Another thing to know about is that when you use the "ASP.NET Core Web Application (.NET Framework)" template it's much easier to link to .Net Library Projects that target the full framework when using Visual Studio. It's possible to do it using the "ASP.NET Core Web Application (.NET Core)" template but it requires some manual editing of the project.json file.
It may also be worth mentioning that if you target the Full Framework the web application must be deployed on Windows, whereas targeting the .Net Core framework allows the web application to be deployed to non-Windows environments. But the .Net Core Framework is not as feature rich as the Full Framework. (It has no drawing routines for resizing images for instance). You can read more about choosing the right framework here: https://docs.asp.net/en/1.0.0-rc1/getting-started/choosing-the-right-dotnet.html
Either way, no matter which of these two templates you select, you will be creating a project for creating an ASP.NET Core application.
Some differences in the actual projects created
Here is what the solution looks like in Visual Studio 2015 Update 3 when "ASP.NET Core Web Application (.NET Core)" is chosen (with Empty option):
And here is its project.json file:
Here is what the solution looks like in Visual Studio 2015 Update 3 when "ASP.NET Core Web Application (.NET Framework)" is chosen (with Empty option):
And here is its project.json file:
ASP.NET Core can run on top of .NET Core or the full .NET Framework. So there's a template depending on whether you want to build on .NET Core or the full .NET Framework.
Here's an infographic that Microsoft put together that visually demonstrates the concept:
No matter which template you choose, you can always edit your configuration to target both at the same time. But the templates just help you get started with one or the other.

ASP.net 5 preview templates are missed in Visual Studio 2015

I have installed Visual Studio 2015 update 3 and have installed the latest Web Essentials update and also have installed DotnetCore version. But when I create a new asp.net project, only asp 4 templates like in the image are available
create form image
First of all, there is no ASP.NET 5 anymore. It has officially been renamed to ASP.NET Core 1.0.
You seem to have missed that announcement, which would have made the selections in Visual Studio more obvious. When you choose File > New Project..., you get to a dialog that gives you a choice to go with ASP.NET Web Application (.NET Framework), ASP.NET Core Web Application (.NET Core) or ASP.NET Core Web Application (.NET Framework). This is the dialog before the one you have posted a screenshot of.
NOTE: In order to see all 3 of these options, you need to choose at least .NET Framework 4.5 from the dropdown.
The last two options are for the new ASP.NET Core 1.0 framework. The first of which is to run on the .NET Core library (cross-platform) and the last which is for the .NET Framework 4.6.1 library (which is not cross-platform).
Of course, if you choose ASP.NET Web Application (.NET Framework) , you get a regular MVC 5 or Web API 2 application.

Categories