Unity 2017 UnityContainer will not resolve - unity3d

I am having a ton of trouble trying to use UnityContainer. Unity will not compile my scripts as it keeps giving me this message :
The type or namespace name `Unity' could not be found. Are you missing an assembly reference?
And
The type or namespace name `UnityContainer' could not be found. Are you missing an assembly reference?
I have been digging around on the web for ages, and have found some people with similar, but not exactly the same problem. So far I have tried :
Uninstalling / Reinstalling Unity (2017.3.0f3)
Uninstalling / Reinstalling Visual Studio ( 2017 )
Changed unity player settings to use Experimental .NET 4.6 equivilant
I have used NuGet to install the Unity Container project, and everything resolves and builds fine in Visual Studio, but Unity keeps giving the missing Namespace error.
I am completely stuck, and at a bit of a loss because I need to use the features UnityContainer provides in order to progress with my game. I have considered using an older version of Unity, but I really want to use the new tilemaps feature. I would be incredibly grateful for any assistance.

Related

Timeline and visual scripting packages are broken after Upgrading Unity to newer version

Earlier this week, my work upgraded Unity from 2021.3.1f1 to 2021.3.13f1. My coworker did this first and I pulled the changes (we are using Plastic SCM) I got these errors:
This is happening for both the Timeline and Visual Scripting Package
I thought that it might be due to being on the wrong version of Unity so I installed the 2021.3.13f1 version and the errors were still there. I have done many different things to try and fix this, but the problem still persists. Here are some of the things I have already tried:
Re-imported both my Assets and Packages folders
Deleted the whole project and re-downloaded it
Reinstalled the new version of Unity
Reset packages to defaults
Used a replace my package cache file with a co-worker's
Used a different workspace and branch in Plastic.
Tried using an entirely different project (the problem persisted in all projects)
Deleted the project and re-created it through cloud saves
Removed both of the packages from the project via the package manager and installed them again (this actually removed the visual scripting error when the package was removed, but the timeline errors persisted)
Using an older version of unity.
This apparently has not affected any of my co-workers and is only happening on my computer. I thought fresh installing EVERYTHING would fix it, but no.
Thanks for the help.

MRTK Photon Unity Networking 'AnchorModuleScript' namespace not found

While following the mrtk tutorial on multi-user capabilities, there has been one CS0246 error that I haven't been able to avoid.
After importing PUN 2 from the asset store, all CS0246 errors from importing the MultiUserCapibilities package are resolved except for Assets\MRTK.Tutorials.MultiUserCapabilities\Scripts\SharingModuleScript.cs(7,17): error CS0246: The type or namespace name 'AnchorModuleScript' could not be found (are you missing a using directive or an assembly reference?).
I have followed this tutorial with my current project on Unity 2020.3.29f, the same project updated to Unity 2021, and a blank Unity 2020 LTS project following only the essential steps (switching build platform, importing MRTK foundation and OpenXR through the feature tool, and setting up MRTK and OpenXR in Unity). All of them only throw this one error. I also updated my Windows SDK and restarted my PC as many other solutions suggest.
My best guess is that this is something on Microsoft's end.
Windows 10 21H2 (OS Build 19044.1645)
Windows SDK version 2104 (10.0.20348.0)
Unity 2020.3.29f1
MRTK 2.7.3
OpenXR 1.4.0
Install this Unity package.
Microsoft assumes you've completed the 'Use Azure Spatial Anchors to anchor objects in the real world' tutorial (in which you download that package on the third page), which is part of the 'HoloLens 2 fundamentals' tutorials. It's also stated that having followed those tutorials is part of the prequisites to the multi-user capabilities tutorial: screenshot.
I've had the same problem, and just fixed it.
There are several packages that you need to install before adding the ones listed at mrtk tutorial on multi-user capabilities.
I solved it by installing the Unity packages of all the steps in HoloLens 2 fundamentals: develop mixed reality applications, you only need to get to the first 2 steps of each Learning Module and install by order their listed Unity Packages.
In short you need to follow the prerequisites to this tutorial.
At the end your Projects tab should look something like this: Screenshot
If you are getting errors from "using Microsoft.Azure.SpatialAnchors" and Azure not being found on imports. Try installing components from the Azure MixedReality Services tab from the MS Mixed Reality Feature Tool.
Before
AzureErrors Before
Imports for solution
Sucessfully found required imports in Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.4.2

HoloLens SpatialMapping not available

I'm working on the tutorial MR Basics 101: https://learn.microsoft.com/en-us/windows/mixed-reality/holograms-101
And set everythings up as suggested in this article: https://learn.microsoft.com/en-us/windows/mixed-reality/install-the-tools
But when I download the Origami sample and open it in Unity in the recommended version 2018.3.X or the other recommended Version the LTS I get the error:
Assets\Holograms\Support\Spatial Mapping\SpatialMapping.cs(24,13): error CS0246: The type or namespace name 'SpatialMappingRenderer' could not be found (are you missing a using directive or an assembly reference?)
Only when I open it in the Unity Version 2017.2.5f1 it does work. Does that mean that only in that version the HoloLens package is available? Or do I have to install it seperatly for the newer versions?
This is a "bug" in later versions of Unity 2018 and above when importing projects with an older version where those 2 classes are not automatically imported. Just go to XR Settings under Player settings and uncheck/check "Virtual Reality Supported". That will re-download the missing classes.
If you use one of the older Mrtk-Versions you have to use the 2017 LTS-version of Unity. If you use MrtkVnext V1 or V2, you have to use Untiy 2018.
But all the tutorials from microsoft are done on Unity 2017 with the old Mrtk-Version, also known as HoloToolKit...there is some confusion regarding the naming.

(Impossible) HtmlAgilityPack not found in Unity

I have a problem with the HtmlAgilityPack...
I have correctly imported the pack in Visual Studio (References > Manage NuGet Packages > Browse, and just installed the package)
In Unity I get this error:
Assets/Scripts/Searcher.cs(13,7): error CS0246: The type or namespace name 'HtmlAgilityPack' could not be found. Are you missing an assembly reference?
I didn't forgot two add using HtmlAgilityPack; in my script
Using ? :
- Unity 2017.2.1f1
- Microsoft Visual Studio Community 2015
- HtmlAgilityPack 1.6.13
Not sure why this was marked impossible. You can do this by simply dropping HTMLAgilityPack.dll into Unity. Unity will recognize the library and make it available in VS2017.
Here's what it looks like in Unity when imported correctly.
I am on (Experimental .Net 4.6), but I doubt that makes a difference.
Based on a similar question over on Unity Answers:
Unity itself is incapable of handling Nuget packages, they're more of a VS thing. But as long as the assembly targets .NET 2.0 you should be able to use the .dll in Unity without issue
I can't find any information on what version of .NET that HtmlAgilityPack targets, but my guess is that it isn't the same as what Unity uses. By default Unity 2017 uses the .NET 3.5 runtime with an option to switch to the experimental 4.6 runtime.
The best compatibility will be with both targetting the same version, but in the case of it differing, Unity will need to be newer as if the dll uses features added by (say) .NET 4.6 and Unity's set to use .NET 3.5, Unity won't be able to handle those calls.
Try changing to the .NET 4.6 experimental runtime and seeing if that works.
Under Edit -> Project -> Player:

Unable To Install Jint 2.1.0.0

I am trying to use Jint in my C# WinForms Application but NuGet is refusing to install the package. I can install other packages perfectly fine including this one called JavaScriptEngineSwitcher.Jint. I googled around and couldn't find anyone else with the same problem. The error says it has a problem with the .NET Framework version but it is my understanding that 4.0 should be just fine (even so, I played around with it but nothing worked).
https://www.nuget.org/packages/Jint/2.1.0
The package does work fine in .NET 4.0 packages. Make sure you have the latest update of the Package Manager console. If it is updated or udpating doesn't work, try restarting Visual Studio and try again.