Mixedrealitytoolkit-unity: diagnostics cannot build using the .net backend

Created on 3 Oct 2018  路  24Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Mixed Reality Toolkit

Describe the bug
I need to build a project using the .net backend (unity 2018.1) for debugging purposes. Currently, I am blocked by the diagnostics feature being unable to locate the Process type (it builds for il2cpp)

To Reproduce

  1. Edit > Project Settings > Player > Other Settings > Scripting Backend == .NET
  2. File > Build Settings > Build

Expected behavior
To be able to build the project against the .NET backend for as long as Unity ships it.

Actual behavior
AssetsMixedRealityToolkit-SDKFeaturesDiagnosticsMemoryUseTracker.cs(12,17): error CS0246: The type or namespace name 'Process' could not be found (are you missing a using directive or an assembly reference?)
AssetsMixedRealityToolkit-SDKFeaturesDiagnosticsCpuUseTracker.cs(13,17): error CS0246: The type or namespace name 'Process' could not be found (are you missing a using directive or an assembly reference?)

Unity Editor Version
2018.1.9f2

Diagnostics / Tools

Most helpful comment

Unity says it'll be removed after 2018.2

Unity says it'll be removed in 2019.1. Until then, MRTK supports it.

Of note:

.NET won't be removed until 2019.1, and it will be supported in 2018.4 LTS branch for 2 more years. If you really need it, you can still use it.

All 24 comments

I'm not sure it's a good idea to continue support for .NET scripting backend.
Unity says it'll be removed after 2018.2, and a lot of things are already broken/won't be fixed (like JsonUtility and others)

Although I'm almost positive that this error will likely show up on other platforms like standalone/OpenVR

I need to be able to debug one of my scripts. unity last stated 2019.1 is when the removal will occur,.

any tricks for debugging c# on a HoloLens when compiling for il2cpp?

I'm not sure it's a good idea to continue support for .NET scripting backend.

Until Unity removes the option, I believe we should do whatever is possible to support it.

Unity says it'll be removed after 2018.2

Unity says it'll be removed in 2019.1. Until then, MRTK supports it.

Of note:

.NET won't be removed until 2019.1, and it will be supported in 2018.4 LTS branch for 2 more years. If you really need it, you can still use it.

any tricks for debugging c# on a HoloLens when compiling for il2cpp?

Use the managed debugger.

There's loads of things broken in .NET that Unity QA is refusing to fix for me.

That link is for Unity 2018.2 which has a blocking bug. I need to debug using 2018.1

Here's one that directly affects the build and cloud systems we will implement soon:

JsonUtility. They're refusing to fix bugs related to .NET.

https://fogbugz.unity3d.com/default.asp?1074066_qunta56rqnn15qca

https://issuetracker.unity3d.com/issues/wsa-uwp-nullreferenceexception-thrown-when-trying-to-parse-json-array-slash-nested-array

That said, Unity is committed to supporting the .NET backend for 2 years with 2018.4. We should not limit our customers if they wish to use the backend.

The real question here is how to get the proper assembly reference into the project.

That's the thing, I don't think they are really that committed. Esp if I've gotten 3 bug reports closed stating that I just need to switch to IL2CPP.

We should not limit our customers if they wish to use the backend.

No we shouldn't, but unity is.

No we shouldn't, but unity is.

And that's fine! We can support building for .NET even if Unity won't fix specific bugs. We should not be the blocker.

Just cause we get it to compile and build doesn't guarantee it'll even work.

Again, that's exactly what I'm saying. We aren't responsible for Unity bugs.

Right, but support has also been dropped. I'm just saying we should also drop support for maintainability.

it will be supported in 2018.4 LTS branch for 2 more years. If you really need it, you can still use it.

We should not drop until our 2019 product. Just like they state

Thanks for staying on top of this @davidkline-ms! Debugging IL2CPP on a device is horrifying! Being able to use .NET when deployed to HoloLens is huge!

We should not limit our customers if they wish to use the backend.

Too bad that's dead soon

There's a workaround for this: Use NuGetForUnity and install https://www.nuget.org/packages/System.Diagnostics.Process/ , which is the netstandard 1.3 compatible library that was shipped to support this scenario. I'm still evaluating if we can include this as a dependency, or if we should approach in a different way.

@davidkline-ms I'm not sure what the next steps are. Restricting functionality in UWP seems bad, and there's a workaround by including the above nuget package. Do we want to close this?

I would much prefer not being able to use diagnostics under .NET to not being able to use .NET at all. If nothing else, can we pragma the diagnostics out under .NET?

Yes, Unity has a pragma for .NET

Gotta look it up, as I don't know it off the top of my head

In that case, I'll make a PR using #if WINDOWS_UWP && !ENABLE_IL2CPP

Can we also update it to remove the boxing calls?

Was this page helpful?
0 / 5 - 0 ratings