Closed jimevans closed 4 years ago
Okay, never mind. These types are documented as only being introduced in .NET Framework 4.7.1. The framework moniker net47
won't find those types. This is working as intended.
Thanks for the detailed issue + the follow-up!
Consider the following C# source file (
CompileIssue.cs
):Further consider the following Bazel build definition file (in the
BazelCompileIssue
directory):Attempting to build such a project using
bazel build //BazelCompileIssue:CompileIssue
yields the following output:This same file compiles fine within Visual Studio. Removing any calls to classes in the
System.Runtime.InteropServices
namespace allows successful compilation under Bazel. A sample Git repo with the above code demonstrating the problem can be found on GitHub.