How to specify import of target ASP.NET infrastructure into a .csproj file (instead of project.json)?

I am building an ASP.NET Core application and trying to install the Azure Storage package.

On the gizub page for storing Azure, it says that I need to put the following in the project.json file, but since it uses the latest version of ASP.NET Core, we don’t have the project.json file, just the .csproj file.

"imports": [ "dnxcore50", "portable-net451+win8" ] 

Is there a way to do this in a .csproj file? I guess the place might be somewhere around this:

  <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp1.1</TargetFramework> <PreserveCompilationContext>true</PreserveCompilationContext> </PropertyGroup> 

Many thanks!

+7
asp.net-core azure
source share
1 answer

After transferring one of my projects to a new model, this is what it generated:

 <PropertyGroup> <TargetFramework>netcoreapp1.6</TargetFramework> <PreserveCompilationContext>true</PreserveCompilationContext> <AssemblyName>TestApp</AssemblyName> <OutputType>Exe</OutputType> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.6' ">$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback> </PropertyGroup> 

Try adding dnxcore50 and portable-net451 + win8 in the same way:

 <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp1.1</TargetFramework> <PreserveCompilationContext>true</PreserveCompilationContext> <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);dnxcore50;portable-net451+win8</PackageTargetFallback> </PropertyGroup> 
+12
source share

All Articles