How to add assemblies in asp.net core - asp.net-core-2.0

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.

Related

Using Microsoft.Azure.NotificationHubs in Azure App Service .NET Backend

When configuring an Azure App Service backend you can choose between either a managed NodeJs project that works with EasyAuth and EasyTables or a full .NET based backend project that you can download and work with.
This project is based on an ASP.NET MVC template using .NET Framework 4.6.
When you want to integrate the Azure NotificationHub, you need to add nuget package references to Microsoft.Azure.NotificationHubs which target dotnetstandard2.0.
How can I either integrate the NotificationHub into my existing .NET backend project or migrate my .NET Framework 4.6 based backend project to dotnetstandard?
d'oh.
As stated on Microsofts compatibility page, dotnetstandard2.0 requires .NET Framework 4.6.1. The template, an Azure App Service .NET Backend is based upon targets .NET Framework 4.6. So migrating this to 4.6.1 solved my problem.

How to ouput Trace statement to Azure Application logs in ASP.NET Core Application?

I've an ASP.NET Core Application (.net Framework) and that references my other .net Framework dlls.
I've configured logging in my ASP.NET Application using "Microsoft.Extensions.Logging.AzureAppServices" and injecting ILogger to controllers. All that works fine. all my logs are written to azure application logs in Azure.
In my .net framework dll, i've Trace.TraceError, TraceWarning statements. And I would like to include them in azure application log. but I cannot find any way to do it.
Looking forward for some help.
You will have to use the logging framework of ASP.NET Core (ILogger and friends) in your .NET Framework class library/DLL if you want them appear in the same application log.
Another option might be to convert the library to use the TraceSource system, there is a logging provider for ASP.NET Core available. If you're unable to make changes to the existing library, I'm afraid you're out of options.

VS 2017 asp.net MVC where is owin startup class

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

How do I add .NET Core class library reference in Service Fabric App

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

Create NUGET package to support Both Asp.Net MVC and Asp.Net core MVC

I have created the library project with TragetFramework is .NetFramework 4.5
I released the library project as Nuget package. By using this Nuget package developer can able to Create Razor Html control in Asp.Net MVC project. This is working as we expected.
My problem is now I want to support Asp.Net core MVC project also. How can I create NUGET package to support Both Asp.Net MVC and Asp.Net core MVC.
Its not possible. MVC packages have to target net40/net45/net46. But ASP.Net Core packages have to target netcoreapp1.0.

Resources