Referencing netstandard Library from net471 Project Results in Compilation Error
Author: thefringeninjaCreated Sep 13, 2019Updated Feb 9, 2026
Labelsarea-Tools: msbuild
Steps to Reproduce
- Start a new
net471project on linux (Linux Mint 19.2) with mono-complete installed. - Add a reference to any netstandard library (I chose
Microsoft.AspNetCore.Server.Kestrel) - Build it
FrameworkPathOverride=/usr/lib/mono/4.7.1-api dotnet build - Resulting in
X.cs(6,5): error CS0012: The type 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
See my repo thefringeninja/mono-repro@b2f01c4 for a reproduction. In addition, I 'fixed' it at thefringeninja/mono-repro@0baabde but this is something I would rather avoid:
sudo ln -s /usr/lib/mono/4.7.1-api/Facades/netstandard.dll /usr/lib/mono/4.7.1-api/netstandard.dll- add
<Reference Include="netstandard" />to the project.
Current Behavior
Doesn't compile
Expected Behavior
Does compile
On which platforms did you notice this
[ ] macOS [x] Linux [ ] Windows
Version Used:
~$ mono --version
Mono JIT compiler version 6.0.0.334 (tarball Thu Sep 12 21:34:14 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: hybrid
GC: sgen (concurrent by default)Source: mono/mono