问题
I have a ".net 4.6.1" (A) project and a ".net core 1.5" (B) project.
I want add a reference to "project_B_core_1.5" in my "project_A_net461".
At the beginning I got:
A reference could not be added. An assembly must have a 'dll' or 'exe' extension in order to be referenced.
Then I tried to add "net461" to "frameworks" in the core project (*). I Tried to add it again to "project_A_net461", and this time there was no error.
The problem is that I can't access the namespace:
The type or namespace 'name_of_B_project' does note exist in the namespace 'name_of_A_project' (are you missing an assembly reference?)
It complains at using name_of_B_project;
.
(*) Like this:
"frameworks": {
"net461": {},
"netstandard1.5": {
"imports": "dnxcore50"
}
}
来源:https://stackoverflow.com/questions/41721131/adding-a-reference-from-a-xproj-to-a-csproj