So it sounds like a trivial task, I just want to use common code from my class library in both my web api and webapp but I am unable to reference the class library from my webapp projects, so I made a clean project to test it out.
I have 3 projects:ClassLib1, ClassLib2, WebApp
I am able to reference ClassLib1 From ClassLib2 but I cannot referance either Class librarys from the webapp project
Here are my project.json's
ClassLib1
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
},
"frameworks": {
"netstandard1.5": {
}
}
}
ClassLib2 is exactly the same as ClassLib1
Web App
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"ClassLib1": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
SS showing using ClassLib1 in ClassLib2 successfully
SS showing error in webapp when trying to use ClassLib1
The error when moused over is `cannot resolve symbol 'ClassFromLib1'
Edit: I just noticed that if I change the web app to use netstandard1.5 from netcoreapp1.0 I can then referance code between the projects.
Should I do this? are there any downside by changing the framework in targeting?

