I created a new web application with VS2017, by choosing asp.net web application and from templates. when the application is created I don't see startup class. no reference to Owin. VS2017 templates don't use Owin?
First, the version of Visual Studio has nothing to do with anything. However, in VS2017, you'll have three choices for a "web application" out of the box: MVC (where you later choose to include MVC, Web Api, or both), Core, and Core on the Full Framework.
The Core projects will have a Startup.cs class, but the MVC project will not, unless you indicate you want Individual Authentication. In that case, a Startup.cs file will be added for the purposes of Identity, but the MVC website, itself, will not be affected or controlled by that.
You can create Owin Project with Visual Studio 2017 by going to
1 . Create new project with ASP.NET (.Net Framework)
2. Select Single Page Application Template
here you go - > new owin project created
Related
I am using mapxtreme in asp.net application. Now in another application of Asp.net Core 2 , I wanT to use the mapxtreme. But not know how to add assemblies and mapxtreme setting in my ASP.NET CORE web project.
Find attached screenshot of web.config of asp.net application (see appSettings and assemblies section).I want to use the same settings in ASP.NET CORE 2 Web Project. Any Idea where to add this in ASP.NET CORE WEB Project ?
Asp.Net Core does not support web.config. Following are few steps to add the reference in Asp.Net Core in your case
You have to move appSettings section from web.config to appsettings.json. You can read more about it at MicroSoft Docs
If mapxtreme is available as nuget package then install it from nuget package. Otherwise create a folder called as third party, copy mapextreme dlls into third party folder and a add reference of these libraries from third party folder. But important thing is mapextreme libraries should be compliant with .NetStandard 2.0.
How do I add .NET Core class library reference in Service Fabric App.
While I'm adding Class Library reference (.NET Core) in WebAPI app, showing Compatibility issues. Please find below What I did, using Visual Studio 2017.
File >> New Project >> Cloud >> Service Fabric Application
Name - FirstServiceFabricApp
Select a Template >> Stateless ASP.NET Core
Name - FirstStatelessAPI
Build and Run the Project. It works.
Although API Project Framework version is .NET Framework 4.5.2.
Added Class Library Project [builds on .NET Core 1.1] as reference into Stateless WebAPI Project. Showing compatibility issues-
Building the solution x64 platform.
My concerns are:
How do I take .NET Core Library reference in Stateless WebAPI Project [Service Fabric]
Should I go/develop with .NET Framework for Class Library which is compatible with Stateless WebAPI project.
I did Azure AD Authentication/Microsoft Graph in Azure APP Service, but never did for Service Fabric App. Whether Azure AD and Microsoft Graph implementation is same in this Stateless WebAPI App. Kindly provide some references on this.
You need to make your class library target a compatible framework e.g. net452 (or netstandard2.0 when it's supported like 2017 Q3)
The below link talks about converting a .net core to azure service fabric application.
It talks about statefulservice. Statelessservice is more or less similar to it.
http://dotnetextensions.blogspot.in/2018/04/convert-dot-net-core-application-to.html?m=1
When it comes to azure ad, i won't have much impact. You can continue to use the same thing
In Visual Studio 2015 ,there's a project templates for some azure service(etc:blob、storage:queue).
Now, I'm using Visual Studio 2017 enterprise ,i can't find the project template after intalled Azure SDK.
How can i fix this?
The quickstarts aren't included in the box in 2017 - you can find the latest here:
https://github.com/Azure-Samples?utf8=%E2%9C%93&q=storage-dotnet&type=&language
Azure Cloud is the monicker for the entire suite of products. Are you looking for the Asp.Net Core template that will run in Azure? Click on .Net Core and choose Asp.Net Web and it will set up a quick start for you that already can be published to Azure. Or was there a specific kind of template are looking for that isn't Asp.Net Core?
Edit: It's possible VS 2017 Azure SDK didn't release console templates yet. Having said that, the templates you have show how to use the Azure Storage code in a .Net Core project. They are less boilerplate and more tutorial. You should create a test one, see how the code works, then create a normal, basic .Net Core Console project and re-implement the code how you want it. There is nothing special about a quick start template except some pre-included dependencies and sample code.
Looking at a standard new MVC 5 project in Visual Studio 2013 you can see that it now includes OWIN.
There's a new OWIN Startup class that configures auth however I can't see how/where MVC5 is registered with OWIN. Where does this happen?
I'm assuming here that all requests pass through OWIN before entering the MVC pipeline. Why else would they include OWIN?
Please note: I'm not asking how OWIN is setup, that's easily explained in the docs. I'm interested in how MVC5 uses OWIN.
Update: I figured out why MVC5 uses OWIN even though requests are handled by the IIS pipeline instead of OWIN.
MVC5 does not pass through OWIN, however it looks like this could change in the future. Instead MVC currently still needs to pass through the IIS Integrated Pipeline. The reason that OWIN is included in the default MVC project is so that MVC5 can use the Owin middleware components.
From the OWIN middleware in the iis integrated pipeline:
In order for an OMC to participate in this same, event-based execution
ordering, the Katana runtime code scans through the startup
configuration and subscribes each of the middleware components to an
integrated pipeline event.
This does change in ASP.NET vNext as Web.Api and MVC have been combined and abandon System.Web in favour of OWIN and project Helios.
MVC 5 is not registered with OWIN.
OWIN is registered to start before application (PreApplicationStartMethod).
And at Pre-application-startup, OwinStartup registered class is used to configure current application.
[assembly: OwinStartup(typeof(WebApplication1.Startup))]
The above line in startup.cs will load the class to configure OWIN.
Look further OWIN Startup class detection
I have an MVC project in Visual Studio 2012 RC which hosts an MVC web site and an ASP.NET API. I use routes to delegate the request to the correct controller.
On my local development machine both the website and api work fine. However when I push the change to Azure websites the website works, but the ASP.NET web api returns HTTP 500 errors.
The base site is: http://salaahtime.azurewebsites.net
One of the web site pages is http://salaahtime.azurewebsites.net/website/login
An example use of the API is http://salaahtime.azurewebsites.net/api/salaahtime/testestablishment/2012/1
However this returns HTTP 500.
I have
Updated my project to use .net 4.0. By default it is set to .net 4.5 which does not work with Azure websites
Removed Entity Framework 5.0 reference which only works with .net 4.5
Any ideas why the api would not work in Azure websites?
There is a known issue when backing a project down from 4.5 to 4.0 using the RC release of Visual Studio 2012. I know this will be slightly painful to hear, but you'll be better off creating a new project and setting the project's framework version to 4 rather than 4.5. This is an issue that should be fixed prior to the product's release.
Hope this helps. Trust me, we know of it and in our own development work have had to re-create projects using the 4 framework.
Also - the 4.5 framework will be supported in Windows Azure Web Sites once the 4.5 framework has been officially released.
Please try to turn off custom error (http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx), which may give more detailed information. If you’re working with a database, make sure you’ve updated the connection string to use Windows Azure SQL Database instead of a local database. There is also a possibility that Web API is not stood by web sites. The name web sites indicate it is used to build web sites, not web platforms. Web sites have limited features compared to web roles and virtual machines. If that’s the case, please use a web role or a virtual machine.
Best Regards,
Ming Xu.