How to specify ASP.NET Core target framework imports in .csproj file (instead of project.json)?

后端 未结 1 1896
夕颜
夕颜 2021-01-05 02:53

I\'m building an ASP.NET Core app, and am trying to install the Azure Storage package.

From the Azure Storage github page, it says I need to place the following in

相关标签:
1条回答
  • 2021-01-05 03:16

    After migrating one of my projects to the 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 a similar fashion, something like this:

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>netcoreapp1.1</TargetFramework>
        <PreserveCompilationContext>true</PreserveCompilationContext>
        <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">$(PackageTargetFallback);dnxcore50;portable-net451+win8</PackageTargetFallback>
    </PropertyGroup>
    
    0 讨论(0)
提交回复
热议问题