Answered by:
Deploy ASP.NET Core 2.1 Preview App to Azure

Question
-
Hi all,
Console .net version check:
trying my first ASP.NET Core 2.1 preview App, so I created a new ASP.NET Core 2.1 preview App from VS (15.6 - Preview 7). Everything runs OK in my local box under VS.
Then I created a new App Service on Azure, installed the Preview1 extension (as seen here) and setup the deployment with my Git Repo. When I push the code from my local box to Git, the Deployment fires-up but I get an error related to the Runtime - [ NU1102: Unable to find package Microsoft.Build.Runtime with version (>= 15.7.0-preview-000011-1378327)].
Am I missing something?
Thanks in advance.
Pedro Cabral
> dotnet --info
D:\home\site\wwwroot
.NET Command Line Tools (2.1.300-preview1-008174)
Product Information:
Version: 2.1.300-preview1-008174
Commit SHA-1 hash: b8df89a54f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x86
Base Path: D:\home\SiteExtensions\AspNetCoreRuntime\sdk\2.1.300-preview1-008174\
Microsoft .NET Core Shared Framework Host
Version : 2.1.0-preview1-26216-03
Build : f2c3216183d20416568a4bbf5bb7d153e826f153
Deployment error:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
Restoring packages for D:\home\site\repository\MyApp\MyApp.csproj...
Restore completed in 450.06 ms for
D:\home\site\repository\MyApp\MyApp.csproj.
D:\home\site\repository\MyApp\MyApp.csproj : error NU1102: Unable to find
package Microsoft.Build.Runtime with version (>= 15.7.0-preview-000011-
1378327) [D:\home\site\repository\MyApp.sln]
D:\home\site\repository\MyApp\MyApp.csproj : error NU1102: - Found 17
version(s) in nuget.org [ Nearest version: 15.6.82 ]
[D:\home\site\repository\MyApp.sln]
Restore failed in 5.43 sec for D:\home\site\repository\MyApp\MyApp.csproj.
Failed exitCode=1, command=dotnet restore
"D:\home\site\repository\MyApp.sln"
An error has occurred during web site deployment.- Moved by Gary Gallanes [HCL Technologies] Monday, March 5, 2018 6:38 PM Not Azure Stack Issue
Sunday, March 4, 2018 3:24 PM
Answers
-
You need to add the package source, so that it is able to restore packages from the preview feed (you must have added a NuGet feed on your development box).
The solution to this is adding a NuGet configuration file to the root of your solution, and adding the package feed to the configuration file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/" />
<add key="dotnetpreview" value="https://dotnet.myget.org/F/aspnetcore-dev/api/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>- Edited by Morten Mertner Tuesday, March 6, 2018 12:06 AM Fixed NuGet config
- Proposed as answer by Sheethal J S Tuesday, March 6, 2018 2:46 AM
- Marked as answer by Pcabralc Tuesday, March 6, 2018 3:58 PM
Monday, March 5, 2018 11:29 PM
All replies
-
You need to add the package source, so that it is able to restore packages from the preview feed (you must have added a NuGet feed on your development box).
The solution to this is adding a NuGet configuration file to the root of your solution, and adding the package feed to the configuration file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/" />
<add key="dotnetpreview" value="https://dotnet.myget.org/F/aspnetcore-dev/api/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>- Edited by Morten Mertner Tuesday, March 6, 2018 12:06 AM Fixed NuGet config
- Proposed as answer by Sheethal J S Tuesday, March 6, 2018 2:46 AM
- Marked as answer by Pcabralc Tuesday, March 6, 2018 3:58 PM
Monday, March 5, 2018 11:29 PM -
Thx Morten! Worked like a charm!Tuesday, March 6, 2018 3:58 PM