Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Why dotnet build giving warning and how to fix these? #4374


User avatar
0
manojreddy created

Hi, I'm getting too many warnings when running dotnet build, Please help me in solving these warnings. My projects were targeting to .net standard 1.0, now I am targeting to .net standard 2.0 with the same code.

c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Application\MyCompany.MyProject.Application.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Dto\MyCompany.MyProject.Business.Dto.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Data\MyCompany.MyProject.Business.Repositories.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Services\MyCompany.MyProject.Business.Services.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Core\MyCompany.MyProject.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.EntityFrameworkCore\MyCompany.MyProject.EntityFrameworkCore.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.MasterDataFiles\MyCompany.MyProject.Business.MasterDataFiles.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors.Core\MyCompany.MyProject.Processors.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj : warning NU1701: Package 'Microsoft.AspNet.WebApi.Client 5.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Web.Core\MyCompany.MyProject.Web.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Web.Core\MyCompany.MyProject.Web.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore.Web 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [c:\Work\Source\MyProject\aspnet-core\MyCompany.MyProject.sln] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Core\MyCompany.MyProject.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Core\MyCompany.MyProject.Core.csproj] c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Web.Core\MyCompany.MyProject.Web.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Web.Core\MyCompany.MyProject.Web.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore.Web 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Application\MyCompany.MyProject.Application.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.EntityFrameworkCore\MyCompany.MyProject.EntityFrameworkCore.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.MasterDataFiles\MyCompany.MyProject.Business.MasterDataFiles.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Services\MyCompany.MyProject.Business.Services.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Dto\MyCompany.MyProject.Business.Dto.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors.Core\MyCompany.MyProject.Processors.Core.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Data\MyCompany.MyProject.Business.Repositories.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj : warning NU1701: Package 'Abp.AspNetZeroCore 1.0.14' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj : warning NU1701: Package 'Microsoft.AspNet.WebApi.Client 5.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.EntityFrameworkCore\MyCompany.MyProject.EntityFrameworkCore.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Application\MyCompany.MyProject.Application.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Dto\MyCompany.MyProject.Business.Dto.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Data\MyCompany.MyProject.Business.Repositories.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.MasterDataFiles\MyCompany.MyProject.Business.MasterDataFiles.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors.Core\MyCompany.MyProject.Processors.Core.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Business.Services\MyCompany.MyProject.Business.Services.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj] C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Web.Core\MyCompany.MyProject.Web.Core.csproj] C:\Users\mreddy.nuget\packages\microsoft.net.sdk.functions\1.0.7\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(32,5): warning : [c:\Work\Source\MyProject\aspnet-core\src\MyCompany.MyProject.Processors\MyCompany.MyProject.Processors.csproj] Tests\TestAppService_Tests.cs(148,27): warning xUnit1013: Public method 'Should_Create_TestPrice_With_Valid_Arguments' on test class 'TestAppService_Test' should be marked as a Fact. [c:\Work\Source\MyProject\aspnet-core\test\MyCompany.MyProject.Tests\MyCompany.MyProject.Tests.csproj] 36 Warning(s) 0 Error(s)


11 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Clean the solution.

  • User Avatar
    0
    manojreddy created

    Still getting same warnings after clean solution.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @ManojReddy,

    Have you tried to restore packages again ? Have you changed project's target framework ?

  • User Avatar
    0
    manojreddy created

    I tried the below scenarios, still giving warning.

    1. Clean, Build
    2. Clean, Package Restore, Build

    Yes, I was on .net core 1.1 before, now targeting all the projects to core2.0.

  • User Avatar
    0
    aaron created
    Support Team

    Make all your projects target netcoreapp2.0 to avoid errors of this form:

    "Package '...' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project."

  • User Avatar
    0
    manojreddy created

    Why I cannot see target framework.core 2.0 in the target framework?

    I have downloaded code from aspnetzero site which was targeting 1.1.

    I downloaded .net standard 2 sdk from Microsoft site. I’m trying to set target framework of projects to core2.0. But I cannot see this option. I’m seeing all .standdard in target framework drop down .

    Then I downloaded the code from aspnetzero site for core2.0. In this project I can see target framework core 2.0.

    So what’s difference between .core 2.0 and .net standards 2.0?

    How it will impact my code which is using the abp framework.

  • User Avatar
    0
    manojreddy created

    What’s difference between .core 2.0 and . net standards 2.0?

    I cannot see .core 2.0 option in the target framework drop down in project properties. I can see only .net standards 1.1......... .net standards 2.0.

    How will it impact by project which is based on abp framework?

    Then I downloaded the project from aspnetzero site for core 2.0. In it’s project I can see .core 1.1 and core2.0 not .net standards, why?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ManojReddy,

    If you want to change target framework of your project, just right click on your project and select "Edit ****.csproj". Then you can change TargetFramework.

    ABP supports both, .Net Standard 2.0 & .Net Core 2.0.

  • User Avatar
    0
    manojreddy created

    But why it's not showing .net core 2.0 in the target framework dropdown list when you right-click the project and select properties.

    Whats difference between .net standard and .net core?

    What do you suggest? Should I target .net standard or .net core?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I'm not sure why VS does not show .Net Core when changing Target Framework. You can change it directly by editing *.csproj files.

    It is better if you can read this document in order to understand purposes of all those, <a class="postlink" href="https://msdn.microsoft.com/en-us/magazine/mt842506.aspx">https://msdn.microsoft.com/en-us/magazine/mt842506.aspx</a>.

    This screenshot is a summary:

  • User Avatar
    0
    manojreddy created

    Thanks Dear :)