I am attempting to deploy a .NET Core app on Ubuntu 16.04. The project contains references to other projects (i.e. not via nuget), locally the app works fine (win10-x64) however on the server when typing dotnet restore
I receive the following log:
XXXXXX@ip-XXX-XXX-XXX-X:/home/XXXXXX$ dotnet restore
log : Restoring packages for /home/XXXXXX/project.json...
error: Unable to resolve 'XXXXXX.Configuration (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
error: Unable to resolve 'XXXXXX.DataModels (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
error: Unable to resolve 'XXXXXX.DAL (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
error: Unable to resolve 'XXXXXX.Application (>= 1.0.0-0)' for '.NETCoreApp,Version=v1.0'.
error: Unable to resolve 'XXXXXX.BLL (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
log : Lock file has not changed. Skipping lock file write. Path: /home/XXXXXX/project.lock.json
log : /home/XXXXXX/project.json
log : Restore failed in 4546ms.
log : Lock file has not changed. Skipping lock file write. Path:
I have reviewed the advice in the related questions here, here and here however none of the solutions seem to fix my issue.
Given the pace of change to the Core framework I will specify the versions in use and the project.json files for the projects:
XXXXXX.Configuration (.NET Core Class Library) project.json:
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.1"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
XXXXXX.DataModels (.NET Core Class Library) project.json
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.1",
"XXXXXX.Application": "1.0.0-0"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
XXXXXX.DAL (.NET Core Class Library) project.json
{
"version": "1.0.0-*",
"dependencies": {
"MySql.Data": "7.0.6-IR31",
"NETStandard.Library": "1.6.1",
"XXXXXX.Application": "1.0.0-0",
"XXXXXX.Configuration": "1.0.0-*",
"XXXXXX.DataModels": "1.0.0-*"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
XXXXXX.Application (.NET Core Class Library) poject.json
{
"version": "1.0.0-0",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Abstractions": "1.1.0",
"Microsoft.AspNetCore.Mvc.Core": "1.1.0",
"Microsoft.AspNetCore.Mvc.DataAnnotations": "1.1.0",
"Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.0",
"MySql.Data": "7.0.6-IR31",
"NETStandard.Library": "1.6.1",
"System.Data.SqlClient": "4.3.0"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
XXXXXX.BLL (.NET Core Class Library) project.json
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Extensions.Configuration.Binder": "1.1.0",
"NETStandard.Library": "1.6.1",
"XXXXXX.Application": "1.0.0-*",
"XXXXXX.Configuration": "1.0.0-*",
"XXXXXX.DAL": "1.0.0-*",
"XXXXXX.DataModels": "1.0.0-*"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
And finally, the .NET Core Web UI proejct which ties it all together:
XXXXXX.WebUI project.json
{
"dependencies": {
"BundlerMinifier.Core": "2.3.327",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Mvc": "1.1.1",
"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Session": "1.1.0",
"PaulMiami.AspNetCore.Mvc.Recaptcha": "1.1.1",
"Microsoft.AspNetCore.Mvc.Abstractions": "1.1.1",
"Microsoft.Extensions.Options": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"XXXXXX.DataModels": {
"version":"1.0.0-*",
"target": "project"
},
"XXXXXX.Application": {
"version": "1.0.0-0",
"target": "project"
},
"XXXXXX.Configuration": {
"version": "1.0.0-*",
"target": "project"
},
"XXXXXX.DAL": {
"version": "1.0.0-*",
"target": "project"
},
"XXXXXX.BLL": {
"version": "1.0.0-*",
"target": "project"
}
},
"tools": {
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"copyToOutput": [ "web.development.environment.json" ]
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"runtimes": {
"win10-x64": {},
"ubuntu.16.04-x64": {}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config",
"global.json",
"project.json",
"web.development.environment.json"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
I also have a global.json which when published resides in the root folder (one level above the projects)
{
"projects": [
"src",
"/home/XXXXXX/XXXXXX.Application.dll",
"/home/XXXXXX/XXXXXX.Configuration.dll",
"/home/XXXXXX/XXXXXX.DataModels.dll",
"/home/XXXXXX/XXXXXX.Common.dll",
"/home/XXXXXX/XXXXXX.BLL.dll",
"/home/XXXXXX/XXXXXX.DAL.dll",
"/home/XXXXXX/XXXXXX.Notifications.Client.dll",
"/home/XXXXXX/XXXXXX.Notifications.DataModels.dll",
"/home/XXXXXX/XXXXXX.WebUI.dll"
]
}
EDIT
The publish/build within VS created the following hierarchy:
/home
/XXXXXX
/bin
/refs
/runtimes
/Views
/wwwroot
global.json
project.json
XXXXXX.Configuration.dll
XXXXXX.Application.dll
XXXXXX.DataModels.dll
XXXXXX.BLL.dll
XXXXXX.DAL.dll
XXXXXX.WebUI.dll
web.config
web.development.environment.json
(+ Many .NET dlls)
So, all projects were build and placed at the same level - seems wrong but hey it's automated.
Help!