- CatBytesAndCoffee
- Posts: 12
- Joined:
Unity requires full .NET Framework?
It appears that to use Noesis with Unity, it requires you to use the full .NET Framework (max 4.8) and is not available for a later version of .NET. Is that accurate?
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Unity requires full .NET Framework?
Noesis API is compatible with .NET Standard 2.0, so it should work with any configuration you want to use in Unity.
Did you find any problems with that?
Did you find any problems with that?
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
Hmm. Thanks for that info! The Noesis Unity Extension for Visual Studio creates a .NET Framework 4.7.2 app. I tried upgrading a working app with the Visual Studio Upgrade extension, but VS keeps complaining about v4.x interaction problems. The Unity reference assemblies (from Unity, not Noesis) all have a 4.8.x version number, so I thought it might be pinned there. Given that it should be possible I'll keep working on it. (Also, I'm quite new to Unity/Noesis...)
Re: Unity requires full .NET Framework?
Just want to remark that this is the Blend project and it is not related to Unity rutime.Hmm. Thanks for that info! The Noesis Unity Extension for Visual Studio creates a .NET Framework 4.7.2 app.
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
I agree, but the main problem that I'm having is that the Reference Include statements in the csproj file won't resolve for the Microsoft files that are provided by Unity. The Unity*.dll files resolve, but Visual Studio shows an error for the Microsoft files (System.*.dll, netstandard.dll, etc.) when the project is loaded in VS after upgrading it. The files are in the location identified by the csproj file, but VS just shows the little warning symbol and doesn't show the correct path in VS. I assume there is some mismatch between the file versions provided by Unity and the .NET version (.NET Standard 2.1 is the current target) but the build log doesn't provide any hints and the VS UI is not helpful. I'm continuing to work on it.
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
Confirmed that VS/msbuild is making a different choice with the upgraded project. It's ignoring the Unity version of the file and using the local .NET version. From msbuild diagnostic log:
Encountered conflict between 'Reference:Microsoft.Win32.Primitives' and 'Reference:C:\Program Files\dotnet\packs\NETStandard.Library.Ref\2.1.0\ref\netstandard2.1\Microsoft.Win32.Primitives.dll'. Choosing 'Reference:C:\Program Files\dotnet\packs\NETStandard.Library.Ref\2.1.0\ref\netstandard2.1\Microsoft.Win32.Primitives.dll' because it comes from a package that is preferred.
Encountered conflict between 'Reference:Microsoft.Win32.Primitives' and 'Reference:C:\Program Files\dotnet\packs\NETStandard.Library.Ref\2.1.0\ref\netstandard2.1\Microsoft.Win32.Primitives.dll'. Choosing 'Reference:C:\Program Files\dotnet\packs\NETStandard.Library.Ref\2.1.0\ref\netstandard2.1\Microsoft.Win32.Primitives.dll' because it comes from a package that is preferred.
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
I have not figured out a way to force msbuild to use the Unity DLLs, so I'm abandoning the upgrade.
I've tried putting the DLL path directly in the Reference Include rather than the HintPath (as in <Reference Include="path_to_dll">) and I've tried adding a Directory.Build.props file to reorder the AssemblySearchPaths. This was just to get the referenced assemblies to resolve. Looked like there was lots more to resolve after that.
I've tried putting the DLL path directly in the Reference Include rather than the HintPath (as in <Reference Include="path_to_dll">) and I've tried adding a Directory.Build.props file to reorder the AssemblySearchPaths. This was just to get the referenced assemblies to resolve. Looked like there was lots more to resolve after that.
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Unity requires full .NET Framework?
In Unity you don't need to mess with the Visual Studio project references, you usually just build your project with Unity and there is no need for any external Microsoft assemblies for Noesis to work, we provide all the source code in our plugin and it gets compiled by Unity.
You have to adapt your code-behind so it references Noesis classes, and not Microsoft classes. Are you already doing that?
You have to adapt your code-behind so it references Noesis classes, and not Microsoft classes. Are you already doing that?
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
Yes, were following the #ifdef guidance. For this exercise I started from scratch using the Noesis documentation for creating a new Unity project. I didn't attempt to add any code; just compiled the solution as-is with the added Noesis projects that were added when I added the Noesis package to the Unity project. It compiled fine (as expected). Then I tried to upgrade the NoesisGUI project to .NET Standard 2.1 using the Visual Studio Upgrade extension. The project references were already in the NoesisGUI and NoesisGUI.Editor .csprof files that were generated by the Noesis package. The Visual Studio upgrade process deleted the Reference Include statements so I added those back. A diff of the before and after shows that VS replaces all of the Reference Include statements with a small number of Reference Update statements. This appeared incorrect to me, so I rolled those changes back.
- CatBytesAndCoffee
- Posts: 12
- Joined:
Re: Unity requires full .NET Framework?
Perhaps I shouldn't have started with the non-Blend solution/projects to try to upgrade, but the NoesisGUI project have a <TargetFrameworkVersion> of v4.7.1
I also tried upgrading a new blend solution created from the Noesis Unity project template for .NET Framework 4.8 and that didn't work out. May look at just trying to migrate to a project created with the standard WPF template.
I also tried upgrading a new blend solution created from the Noesis Unity project template for .NET Framework 4.8 and that didn't work out. May look at just trying to migrate to a project created with the standard WPF template.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest