I tried to reference System.Device in a Razor view of my MVC C# project. It complained that the reference was missing even after I added it to the project. I did not have the assembly in my GAC, and to test I added the below dummy line in my global.asax.cs file (and compiled with multiple debug flags enabled, I wouldn't imagine it was optimized away).
new System.Device.Location.GeoCoordinate();
as well as this line in my controller's action:
System.Diagnostics.Debug.WriteLine(System.Device.Location.GeoCoordinate.Unknown.IsUnknown);
This still did not do it. Finding this solution I checked my GAC but it was not there (which made sense, but good to check). After finding this solution I marked the reference as Copy Local and the issue went away.
Why did I need to mark my reference as Copy Local even though I explicitly made a call to the library?