I've got a solution that builds locally and I've created a new build and added one step to it
dotnet restore
I'm getting this error message:
... OTHER SUCCESSFUL INSTALLATIONS ...
log : Installing Microsoft.Extensions.FileProviders.Abstractions 1.0.0.
log : Installing Microsoft.Extensions.Configuration.Abstractions 1.0.0.
log : Installing Microsoft.Extensions.DependencyInjection.Abstractions 1.0.0.
log : Writing lock file to disk. Path: C:\a\1\s\Wedding.WebApp\project.lock.json
log : C:\a\1\s\Wedding.WebApp\project.json
log : Restore failed in 13722ms.
Errors in C:\a\1\s\Wedding.WebApp\project.json
Unable to resolve 'Wedding.Application' for '.NETFramework,Version=v4.6.1'.
Unable to resolve 'Wedding.Common' for '.NETFramework,Version=v4.6.1'.
Unable to resolve 'Wedding.WebApp.Setup' for '.NETFramework,Version=v4.6.1'.
Its refering to the three other projects that my main web project references.
This is my project.json
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"net461": {
"dependencies": {
"Wedding.Application": {
"target": "project"
},
"Wedding.Common": {
"target": "project"
},
"Wedding.WebApp.Setup": {
"target": "project"
}
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Does anyone know why this might be erroring?
Based on this answer to the same question:
Replace the project with a .NET Core class library. It worked for me.
i`ve got simular problem. Solve that by manually swap project order in solution file.
Lib was .NetStandard 1.1 and Web.App on .NetFramework 4.6 Core 1.0.
Default project order doesn`t worked for me. After swap all fine.
Your
dependencies
andframeworks
block don't look correct to me: I would expect the libraries you depend on to be declared within thedependencies
block, not theframeworks
block. It would more typically resemble this, for one project referencing another: