Unit Testing with 100.3

579
3
Jump to solution
09-04-2018 10:48 AM
JasonDick
New Contributor II

100.3 removed the ArcGISRuntimeEnvironment.InstallPath property. Now I cannot run unit tests because: "Unable to find ArcGISRuntime deployment folder." How I can I fix this? Visual Studio 2017 15.8.2, xUnit 2.4. I'm using .NET 4.7.2 because the runtime doesn't recognize .NET Core as a valid target....

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

The ArcGIS Runtime does not support running under .NET Core. "Only" .NET Framework 4.6.1+, .NET Native with UWP or Mono on Android/iOS is supported.

The install path property you're referring to is specific to .NET Framework. I'm guessing because you're trying to target .NET Core, it's pulling in the .NET Standard library during compilation, which only contains common members  across all of the above. It is however a compile-time only reference assembly and isn't using during execution (we're using bait'n'switch to execute with the correct ArcGIS Runtime Assembly). It's only there to allow you to compile .NET Standard class libraries that references the ArcGIS runtime. However your app project heads(which your unit test project is one of) must be one of the above mentioned targets.

View solution in original post

3 Replies
dotMorten_esri
Esri Notable Contributor

The ArcGIS Runtime does not support running under .NET Core. "Only" .NET Framework 4.6.1+, .NET Native with UWP or Mono on Android/iOS is supported.

The install path property you're referring to is specific to .NET Framework. I'm guessing because you're trying to target .NET Core, it's pulling in the .NET Standard library during compilation, which only contains common members  across all of the above. It is however a compile-time only reference assembly and isn't using during execution (we're using bait'n'switch to execute with the correct ArcGIS Runtime Assembly). It's only there to allow you to compile .NET Standard class libraries that references the ArcGIS runtime. However your app project heads(which your unit test project is one of) must be one of the above mentioned targets.

JasonDick
New Contributor II

I see. Thank you for the prompt reply. I'm not that familiar with the Runtime organization, but would it be possible to change this? For example, my only interest is in the Geometry namespace. If that was in it's own DLL, .NET Core would be targetable, assuming it had no Framework dependencies. Not suggesting this would be trivial, but another geo library I use does this which makes it easier to work with.

0 Kudos
dotMorten_esri
Esri Notable Contributor

would it be possible to change this

Sorry no. The runtime is actually 99% C++, and the .NET piece is merely a wrapper around it. That means it can't just run anywhere where .NET Core can run, without the necessary C++ libraries deployed with it for that platform as well.