Asp.net core referencing an assembly on a mac
I've been trying to link to a dll while running asp.net core app on my Mac. Earlier I came through some threads on the same rep which were mentioning that asp.net core is p2p etc. but then I found project.json reference that has an entry for specifying dll's.
"frameworks": {
"netcoreapp1.0": {
"bin": {
"assembly": "c:/otherProject/otherdll.dll"
}
}
}
Steps to reproduce
Since I'm on the mac I updated to the following.
"assembly": "/Users/myname/Documents/TestProject/libs/MyLib.dll"
Expected behavior
I should be able to not only link the dll but to be able to see code hinting/Intellisense in my Visual Studio Code for mac.
Also if possible is there a way to specify relative paths to the project instead of absolute path to the DLLs?
Actual behavior
Instead I get an error
/Users/myname/Documents/TestProject/Startup.cs(10,7):
error CS0246: The type or namespace name 'MyLib' could not be found (are you missing a using directive or an assembly reference?)
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information: Version: 1.0.0-preview2-1-003177 Commit SHA-1 hash: a2df9c2576
Runtime Environment: OS Name: Mac OS X OS Version: 10.12 OS Platform: Darwin RID: osx.10.12-x64
@casamm We are no longer actively developing support for the project.json format, as we have moved to MSBuild since preview3.
I am not sure what kind of support to project.json VS for MAC has either.
We do support
In the mean time, even though this does not work in VS for MAC, have you tried restoring and building through the command line?
dotnet restore didn't work. I copied source files for the dll to my project for the time being to work it out, I look forward to .net core support. Also enlighten me please on the MSBuild workflow/template.
We have release 1.0.1 of the CLI a couple of weeks ago.
We have a dotnet migrate command on the CLI that converts your project.json projects to csproj. Also, the latest preview of VS for MAC supports this new csproj format. Though, it is in preview for them.
good news, i like the way where it's heading. Utilizing csproj instead of project.json is much better since it's cross platform. I've few questions
-
how do I link a Portable Class Library or .netcore dll with my project? (I'm on a mac)
-
Can you create a custom dll based library project (.netcore or PCL) on the mac?
-
Is there a nuget integration or how can we pull code from nuget?
-
Can it handle solution file (.sln) if I've a multi-modular project app?