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?
Your dependencies
and frameworks
block don't look correct to me: I would expect the libraries you depend on to be declared within the dependencies
block, not the frameworks
block. It would more typically resemble this, for one project referencing another:
{
"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",
"Wedding.Application": { "target": "project" },
"Wedding.Common": { "target": "project" },
"Wedding.WebApp.Setup": { "target": "project" }
},
"frameworks": {
"net461": {
"imports": []
}
},
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With