0
votes

I am following microsoft documentation to deploy .Net core with sql. when I go to my website the following is displayed:

An error occurred while starting the application. .NET Core X86 v4.1.1.0 | Microsoft.AspNetCore.Hosting version 1.1.2 |
Microsoft Windows 10.0.14393 | Need help?

When I run the app on local machine there are no errors and I am able to add toDo Items. In my CsProj file:

 <TargetFramework>netcoreapp1.1</TargetFramework>

I have seen other people with similar issue discuss a global.json file, but i do not see any and am not sure if I should create one and what exactly to put in it.

Possibly Related info: When I push to azure in command line I get this error:

warning NU1701: Package 'Microsoft.Composition 1.0.27' was restored using '.NETPortable,Version=v0.0,Profile=Profile259' instead of the project target framework '.NETCoreApp,Version=v1.1'. This package may not be fully compatible with your project. remote: Restore completed in 269.7 ms for D:\home\site\repository\DotNetCoreSqlDb.csproj.

the deployment is successful though.

1

1 Answers

2
votes

You could try to add the below to the <PropertyGroup> element in your DotNetCoreSqlDb.csproj

<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>

This is because the Microsoft.Composition 1.0.27 is an old nuget package which does not compatible with the your project target framework which is .NET Core 1.1.

The supported framework for the Microsoft.Composition 1.0.27 is as below:

Supported Platforms:

  • .NET Framework 4.5
  • Windows 8
  • Windows Phone 8.1
  • Windows Phone Silverlight 8
  • Portable Class Libraries

Reference: Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1