microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Azure spatial anchors not working in hololens 2 tutorial, build errors in Unity #8839

Closed Jukka-L closed 9 months ago

Jukka-L commented 3 years ago

Describe the bug

I followed this tutorial very carefully step-by-step: https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-asa-01

When I got this part https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-asa-02#trying-the-basic-behaviors-of-azure-spatial-anchors And tried to build it in unity I was able to get it built, but with a bunch of errors:

// errors separated with --
Missing security values in Resources\SpatialAnchorConfig
UnityEngine.Debug:LogWarning(Object)
SpatialAnchorsUnityBuildProcessing:OnPreprocessBuild(BuildReport) (at Assets/AzureSpatialAnchors.SDK/Editor/SpatialAnchorsUnityBuildProcessing.cs:107)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--

Reference Rewriter found some errors while running with command "--target=Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" "--target=Temp\StagingArea\Data\Managed\UnityEngine.SpatialTracking.dll" "--target=Temp\StagingArea\Data\Managed\UnityEngine.XR.LegacyInputHelpers.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.TeleportSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.SceneSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.InputSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.InputSimulation.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.InputAnimation.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.DiagnosticsSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.CameraSystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Services.BoundarySystem.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Providers.XRSDK.WindowsMixedReality.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Providers.XRSDK.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Providers.WindowsVoiceInput.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.Shared.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Providers.WindowsMixedReality.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Gltf.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.Async.dll" "--target=Temp\StagingArea\Data\Managed\Microsoft.MixedReality.Toolkit.SDK.dll" "--target=Temp\StagingArea\Data\Managed\Unity.Subsystem.Registration.dll" "--target=Temp\StagingArea\Data\Managed\Unity.Timeline.dll" "--target=Temp\StagingArea\Data\Managed\Unity.TextMeshPro.dll" "--target=Temp\StagingArea\Data\Managed\Unity.XR.WindowsMR.dll" "--target=Temp\StagingArea\Data\Managed\Unity.XR.ARSubsystems.dll" "--target=Temp\StagingArea\Data\Managed\Unity.XR.ARFoundation.dll" "--target=Temp\StagingArea\Data\Managed\RestSharp.dll" "--additionalreferences=Temp\StagingArea\Data\Managed,Temp\StagingArea\Data\Managed\Plugins\X64,Temp\StagingArea\Data\Managed\Plugins\ARM,Temp\StagingArea\Data\Managed\Plugins\ARM64,Temp\StagingArea\Data\Managed\Plugins\X86" "--platform=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0\Facade\Windows.winmd" "--dbg=pdb" "--framework=Temp\StagingArea\Data\Managed" "--alt=Microsoft.Win32.SafeHandles,mscorlib;System,mscorlib;System,System;System,System.ComponentModel.Composition;System,System.Core;System.CodeDom.Compiler,System;System.Collections,mscorlib;System.Collections.Concurrent,mscorlib;System.Collections.Concurrent,System;System.Collections.Generic,mscorlib;System.Collections.Generic,System;System.Collections.Generic,System.Core;System.Collections.ObjectModel,mscorlib;System.Collections.ObjectModel,System;System.Collections.Specialized,System;System.ComponentModel,System;System.ComponentModel.DataAnnotations,System.ComponentModel.DataAnnotations;System.ComponentModel.DataAnnotations.Schema,System.ComponentModel.DataAnnotations;System.Data,System.Data;System.Data.Common,System.Data;System.Diagnostics,mscorlib;System.Diagnostics,System;System.Diagnostics.CodeAnalysis,mscorlib;System.Diagnostics.Contracts,mscorlib;System.Diagnostics.Tracing,mscorlib;System.Dynamic,System.Core;System.Globalization,mscorlib;System.IO,mscorlib;System.IO,System;System.IO,System.Core;System.IO,System.Runtime.WindowsRuntime.UI.Xaml;System.IO.Compression,System;System.IO.Compression,System.IO.Compression.FileSystem;System.IO.IsolatedStorage,mscorlib;System.Linq,System.Core;System.Linq.Expressions,System.Core;System.Net,System;System.Net.NetworkInformation,System;System.Net.Security,System;System.Net.Sockets,System;System.Numerics,System.Numerics;System.Reflection,mscorlib;System.Reflection.Emit,mscorlib;System.Resources,mscorlib;System.Runtime,mscorlib;System.Runtime.CompilerServices,mscorlib;System.Runtime.CompilerServices,System.Core;System.Runtime.ExceptionServices,mscorlib;System.Runtime.InteropServices,mscorlib;System.Runtime.InteropServices,System;System.Runtime.InteropServices,System.Core;System.Runtime.InteropServices.ComTypes,mscorlib;System.Runtime.InteropServices.ComTypes,System;System.Runtime.InteropServices.WindowsRuntime,mscorlib;System.Runtime.Serialization,mscorlib;System.Runtime.Serialization,System.Runtime.Serialization;System.Runtime.Serialization.Json,System.Runtime.Serialization;System.Runtime.Versioning,mscorlib;System.Runtime.Versioning,System;System.Security,mscorlib;System.Security.Authentication,System;System.Security.Authentication.ExtendedProtection,System;System.Security.Claims,mscorlib;System.Security.Principal,mscorlib;System.ServiceModel,System.ServiceModel;System.ServiceModel.Channels,System.ServiceModel;System.ServiceModel.Description,System.ServiceModel;System.ServiceModel.Dispatcher,System.ServiceModel;System.ServiceModel.Security,System.ServiceModel;System.ServiceModel.Security.Tokens,System.ServiceModel;System.Text,mscorlib;System.Text.RegularExpressions,System;System.Threading,mscorlib;System.Threading,System;System.Threading,System.Core;System.Threading.Tasks,mscorlib;System.Threading.Tasks,System.Core;System.Windows.Input,System;System.Xml,System.Runtime.Serialization;System.Xml,System.Xml;System.Xml.Linq,System.Xml.Linq;System.Xml.Schema,System.Xml;System.Xml.Serialization,System.Xml;<winmd>,Windows.winmd;<winmd>,Windows.AI.MachineLearning.MachineLearningContract.winmd;<winmd>,Windows.AI.MachineLearning.Preview.MachineLearningPreviewContract.winmd;<winmd>,Windows.ApplicationModel.Calls.Background.CallsBackgroundContract.winmd;<winmd>,Windows.ApplicationModel.Calls.CallsPhoneContract.winmd;<winmd>,Windows.ApplicationModel.Calls.CallsVoipContract.winmd;<winmd>,Windows.ApplicationModel.CommunicationBlocking.CommunicationBlockingContract.winmd;<winmd>,Windows.ApplicationModel.SocialInfo.SocialInfoContract.winmd;<winmd>,Windows.ApplicationModel.StartupTaskContract.winmd;<winmd>,Windows.Devices.Custom.CustomDeviceContract.winmd;<winmd>,Windows.Devices.DevicesLowLevelContract.winmd;<winmd>,Windows.Devices.Printers.PrintersContract.winmd;<winmd>,Windows.Devices.SmartCards.SmartCardBackgroundTriggerContract.winmd;<winmd>,Windows.Devices.SmartCards.SmartCardEmulatorContract.winmd;<winmd>,Windows.Foundation.FoundationContract.winmd;<winmd>,Windows.Foundation.UniversalApiContract.winmd;<winmd>,Windows.Gaming.XboxLive.StorageApiContract.winmd;<winmd>,Windows.Graphics.Printing3D.Printing3DContract.winmd;<winmd>,Windows.Networking.Connectivity.WwanContract.winmd;<winmd>,Windows.Networking.Sockets.ControlChannelTriggerContract.winmd;<winmd>,Windows.Security.Isolation.IsolatedWindowsEnvironmentContract.winmd;<winmd>,Windows.Services.Maps.GuidanceContract.winmd;<winmd>,Windows.Services.Maps.LocalSearchContract.winmd;<winmd>,Windows.Services.Store.StoreContract.winmd;<winmd>,Windows.Services.TargetedContent.TargetedContentContract.winmd;<winmd>,Windows.Storage.Provider.CloudFilesContract.winmd;<winmd>,Windows.System.Profile.ProfileHardwareTokenContract.winmd;<winmd>,Windows.System.Profile.ProfileSharedModeContract.winmd;<winmd>,Windows.System.Profile.SystemManufacturers.SystemManufacturersContract.winmd;<winmd>,Windows.System.SystemManagementContract.winmd;<winmd>,Windows.UI.ViewManagement.ViewManagementViewScalingContract.winmd;<winmd>,Windows.UI.Xaml.Core.Direct.XamlDirectContract.winmd;<winmd>,Windows.ApplicationModel.Activation.ActivatedEventsContract.winmd;<winmd>,Windows.ApplicationModel.Activation.ActivationCameraSettingsContract.winmd;<winmd>,Windows.ApplicationModel.Activation.ContactActivatedEventsContract.winmd;<winmd>,Windows.ApplicationModel.Activation.WebUISearchActivatedEventsContract.winmd;<winmd>,Windows.ApplicationModel.Background.BackgroundAlarmApplicationContract.winmd;<winmd>,Windows.ApplicationModel.Calls.LockScreenCallContract.winmd;<winmd>,Windows.ApplicationModel.FullTrustAppContract.winmd;<winmd>,Windows.ApplicationModel.Preview.InkWorkspace.PreviewInkWorkspaceContract.winmd;<winmd>,Windows.ApplicationModel.Preview.Notes.PreviewNotesContract.winmd;<winmd>,Windows.ApplicationModel.Resources.Management.ResourceIndexerContract.winmd;<winmd>,Windows.ApplicationModel.Search.Core.SearchCoreContract.winmd;<winmd>,Windows.ApplicationModel.Search.SearchContract.winmd;<winmd>,Windows.ApplicationModel.Wallet.WalletContract.winmd;<winmd>,Windows.Devices.Portable.PortableDeviceContract.winmd;<winmd>,Windows.Devices.Printers.Extensions.ExtensionsContract.winmd;<winmd>,Windows.Devices.Scanners.ScannerDeviceContract.winmd;<winmd>,Windows.Devices.Sms.LegacySmsApiContract.winmd;<winmd>,Windows.Gaming.Input.GamingInputPreviewContract.winmd;<winmd>,Windows.Gaming.Preview.GamesEnumerationContract.winmd;<winmd>,Windows.Gaming.UI.GameChatOverlayContract.winmd;<winmd>,Windows.Gaming.UI.GamingUIProviderContract.winmd;<winmd>,Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract.winmd;<winmd>,Windows.Management.Deployment.Preview.DeploymentPreviewContract.winmd;<winmd>,Windows.Management.Workplace.WorkplaceSettingsContract.winmd;<winmd>,Windows.Media.AppBroadcasting.AppBroadcastingContract.winmd;<winmd>,Windows.Media.AppRecording.AppRecordingContract.winmd;<winmd>,Windows.Media.Capture.AppBroadcastContract.winmd;<winmd>,Windows.Media.Capture.AppCaptureContract.winmd;<winmd>,Windows.Media.Capture.AppCaptureMetadataContract.winmd;<winmd>,Windows.Media.Capture.CameraCaptureUIContract.winmd;<winmd>,Windows.Media.Capture.GameBarContract.winmd;<winmd>,Windows.Media.Devices.CallControlContract.winmd;<winmd>,Windows.Media.MediaControlContract.winmd;<winmd>,Windows.Media.Playlists.PlaylistsContract.winmd;<winmd>,Windows.Media.Protection.ProtectionRenewalContract.winmd;<winmd>,Windows.Networking.NetworkOperators.LegacyNetworkOperatorsContract.winmd;<winmd>,Windows.Networking.XboxLive.XboxLiveSecureSocketsContract.winmd;<winmd>,Windows.Perception.Automation.Core.PerceptionAutomationCoreContract.winmd;<winmd>,Windows.Security.EnterpriseData.EnterpriseDataContract.winmd;<winmd>,Windows.Security.ExchangeActiveSyncProvisioning.EasContract.winmd;<winmd>,Windows.System.Profile.ProfileRetailInfoContract.winmd;<winmd>,Windows.System.UserProfile.UserProfileContract.winmd;<winmd>,Windows.System.UserProfile.UserProfileLockScreenContract.winmd;<winmd>,Windows.UI.ApplicationSettings.ApplicationsSettingsContract.winmd;<winmd>,Windows.UI.Core.AnimationMetrics.AnimationMetricsContract.winmd;<winmd>,Windows.UI.Core.CoreWindowDialogsContract.winmd;<winmd>,Windows.UI.Shell.SecurityAppManagerContract.winmd;<winmd>,Windows.UI.Xaml.Hosting.HostingContract.winmd;<winmd>,Windows.Web.Http.Diagnostics.HttpDiagnosticsContract.winmd;<winmd>,Windows.Embedded.DeviceLockdown.DeviceLockdownContract.winmd;<winmd>,Windows.Networking.NetworkOperators.NetworkOperatorsFdnContract.winmd;<winmd>,Windows.Phone.PhoneContract.winmd;<winmd>,Windows.Phone.StartScreen.DualSimTileContract.winmd;<winmd>,Windows.UI.WebUI.Core.WebUICommandBarContract.winmd;<winmd>,Windows.UI.Core.Preview.Communications.PreviewCommunicationsContract.winmd".
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlDecode(System.String).
Error: method `System.String System.Web.HttpUtility::UrlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlDecode(System.String).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlDecode(System.String).
Error: method `System.String System.Web.HttpUtility::HtmlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlDecode(System.String).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlEncode(System.String).
Error: method `System.String System.Web.HttpUtility::HtmlEncode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlEncode(System.String).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlEncode(System.String,System.Text.Encoding).
Error: method `System.String System.Web.HttpUtility::UrlEncode(System.String,System.Text.Encoding)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlEncode(System.String,System.Text.Encoding).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlAttributeEncode(System.String).
Error: method `System.String System.Web.HttpUtility::HtmlAttributeEncode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlAttributeEncode(System.String).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Parameter RestSharp.Authenticators.OAuth1Authenticator/<>c::<AddOAuthData>b__69_9(RestSharp.Authenticators.OAuth.WebPair).
Error: method `System.String System.Web.HttpUtility::UrlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Parameter RestSharp.Authenticators.OAuth1Authenticator/<>c::<AddOAuthData>b__69_9(RestSharp.Authenticators.OAuth.WebPair).
Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Authenticators.OAuth.OAuthWebQueryInfo RestSharp.Authenticators.OAuth.OAuthWorkflow::BuildProtectedResourceInfo(System.String,RestSharp.Authenticators.OAuth.WebParameterCollection,System.String).
Error: method `System.Collections.Specialized.NameValueCollection System.Web.HttpUtility::ParseQueryString(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Authenticators.OAuth.OAuthWebQueryInfo RestSharp.Authenticators.OAuth.OAuthWorkflow::BuildProtectedResourceInfo(System.String,RestSharp.Authenticators.OAuth.WebParameterCollection,System.String).

UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1162)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlDecode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::UrlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlDecode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlDecode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::HtmlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlDecode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlEncode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::HtmlEncode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlEncode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlEncode(System.String,System.Text.Encoding).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::UrlEncode(System.String,System.Text.Encoding)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::UrlEncode(System.String,System.Text.Encoding).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlAttributeEncode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::HtmlAttributeEncode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at System.String RestSharp.Extensions.StringExtensions::HtmlAttributeEncode(System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Parameter RestSharp.Authenticators.OAuth1Authenticator/<>c::<AddOAuthData>b__69_9(RestSharp.Authenticators.OAuth.WebPair).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.String System.Web.HttpUtility::UrlDecode(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Parameter RestSharp.Authenticators.OAuth1Authenticator/<>c::<AddOAuthData>b__69_9(RestSharp.Authenticators.OAuth.WebPair).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: type `System.Web.HttpUtility` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Authenticators.OAuth.OAuthWebQueryInfo RestSharp.Authenticators.OAuth.OAuthWorkflow::BuildProtectedResourceInfo(System.String,RestSharp.Authenticators.OAuth.WebParameterCollection,System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--
Reference rewriter: Error: method `System.Collections.Specialized.NameValueCollection System.Web.HttpUtility::ParseQueryString(System.String)` doesn't exist in target framework. It is referenced from RestSharp.dll at RestSharp.Authenticators.OAuth.OAuthWebQueryInfo RestSharp.Authenticators.OAuth.OAuthWorkflow::BuildProtectedResourceInfo(System.String,RestSharp.Authenticators.OAuth.WebParameterCollection,System.String).
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1164)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:206)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--

//Visual studio 2019 errors appearing when opening the editor, probably not related:
error : Designtime build failed for project 'C:\"Path...\AzureSampleTwo.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
    Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\"Path..."\AzureSampleTwo.vcxproj' configuration 'Release|ARM'. IntelliSense might be unavailable.
    Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\C:\"Path..."\AzureSampleTwo.vcxproj' configuration 'Release|ARM64'. IntelliSense might be unavailable.
    Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\"Path..."\AzureSampleTwo.vcxproj' configuration 'Release|ARM64'. IntelliSense might be unavailable.
    Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
---

In the hololens 2 application, on step 3 (Create Azure Anchor) there's an error message displayed. I'm having hard time getting the error message out completely from the app, if required I can dig deeper.

To reproduce

Steps to reproduce the behavior: Follow the tutorial linked in description and build in Unity, Try out the application and try to create an azure spatial anchor.

Expected behavior

A working unity build without error messages, a working sample hololens 2 application which doesn't give errors when trying to create an azure spatial anchor.

Setup

Target platform

Pandalex1 commented 3 years ago

Hello, I get exactly the same errors with Unity 2019.4.3f1 but, I can build and even install the application, but I can't put any anchors due to errors.

MaxWang-MS commented 3 years ago

@polar-kev Kevin maybe you can help redirect the issue to the ASA team?

Bathur commented 3 years ago

@HurjaSolutionsJukkaL @Pandalex1

  1. Select "..\Assets\MRTK.Tutorials.AzureSpatialAnchors\Plugins\RestSharp.dll"
  2. Change the settings of the inspector panel 2.1 Platform settings->SDK->UWP 2.2 Check "Don't process" 2.3 Uncheck “Select platforms for plugin->Any Platform”, and Check ALL platforms below P.S. I'm not sure which step took effect. For steps 2.1 to 2.3, I did it together. According to experience, I think step 2.1 is the key, but I still did 2.2 and 2.3 to ensure that it is correct.
polar-kev commented 3 years ago

@mr0ng, any advice on this one? @hferrone, what's the best way to route this to the DMC github repo so it can live with the tutorial?

mr0ng commented 3 years ago

@polar-kev yes, looks like the solution is provided in the comment above. For a longer term solution, we may need to look at removing the rest sharp dependency and use UnityWebRequest, which is built in.

Pandalex1 commented 3 years ago

Hello @Bathur , your solution works to me, with step 2.1 and 2.2 works!, I can export without those errors, BUT, for some reason I can't create any anchors, when I try, the debug shows a lot of errors so I'm stuck again:

https://imgur.com/a/mGz1bj8

mr0ng commented 3 years ago

@Pandalex1 are you able to share your tutorial repo via GitHub so we can see how you've configured it on your end?

Bathur commented 3 years ago

@Pandalex1 I have seen this runtime error message, but I have seen it when I have not resolved the build error. You may be able to try to upgrade the ASA plugin version to the latest version. I later changed the version provided in the tutorial to 2.7.0 and it still worked.

Pandalex1 commented 3 years ago

@Bathur I tried with ASA 2.7 and got the same error:

https://imgur.com/a/u0ROsSt

Jukka-L commented 3 years ago

@HurjaSolutionsJukkaL @Pandalex1

  1. Select "..\Assets\MRTK.Tutorials.AzureSpatialAnchors\Plugins\RestSharp.dll"
  2. Change the settings of the inspector panel 2.1 Platform settings->SDK->UWP 2.2 Check "Don't process" 2.3 Uncheck “Select platforms for plugin->Any Platform”, and Check ALL platforms below P.S. I'm not sure which step took effect. For steps 2.1 to 2.3, I did it together. According to experience, I think step 2.1 is the key, but I still did 2.2 and 2.3 to ensure that it is correct.

Thanks, this removed Unity build-time errors for me too, but unfortunately in the built application I'm receiving the same errors as @Pandalex1 mentioned earlier.

Bathur commented 3 years ago

@HurjaSolutionsJukkaL Strangely, after I did the steps I shared, the program worked normally. I tried the asa plug-in version (2.4) provided by the tutorial and the asa plug-in version (2.6, 2.7) referenced by UPM, and there is no problem. My unity version has used 2019.4.15f1 and 2019.4.16f1. This is all the information I can provide.

Jukka-L commented 3 years ago

@Bathur

Strangely, after I did the steps I shared, the program worked normally. I tried the asa plug-in version (2.4) provided by the tutorial and the asa plug-in version (2.6, 2.7) referenced by UPM, and there is no problem. My unity version has used 2019.4.15f1 and 2019.4.16f1. This is all the information I can provide.

Would you be able to make a github repo of your project so I could try it out and see if I can find some differences? Just remember to remove all sensitive information like azure account information etc.

Pandalex1 commented 3 years ago

Hello @HurjaSolutionsJukkaL , good news! I managed to make it work, I did exactly the same proyect, but instead of using AzureSpatialAnchors.unitypackage (2.2.1), I used AzureSpatialAnchors.unitypackage (2.5) from: https://github.com/Azure/azure-spatial-anchors-samples/releases

But, I noticed that ASA 2.7 says: "This SDK 2.7.0 release contains an important change. All clients are required to upgrade to 2.7.0 SDK or later before February 3, 2021. Any client application on earlier versions of Azure Anchors SDK will not be able to connect to the ASA service starting February 3, 2021.", so I think I'll have to upgrade to 2.7 eventually, but now i'm finally able to check how to use ASA. I hope it works for you too.

Jukka-L commented 3 years ago

Hello @HurjaSolutionsJukkaL , good news! I managed to make it work, I did exactly the same proyect, but instead of using AzureSpatialAnchors.unitypackage (2.2.1), I used AzureSpatialAnchors.unitypackage (2.5) from: https://github.com/Azure/azure-spatial-anchors-samples/releases

But, I noticed that ASA 2.7 says: "This SDK 2.7.0 release contains an important change. All clients are required to upgrade to 2.7.0 SDK or later before February 3, 2021. Any client application on earlier versions of Azure Anchors SDK will not be able to connect to the ASA service starting February 3, 2021.", so I think I'll have to upgrade to 2.7 eventually, but now i'm finally able to check how to use ASA. I hope it works for you too.

I got it working too using the 2.7 version by starting a fresh project, following the instructions of the tutorial in original post, but instead of installing the 2.2.1 unitypackage, I went directly to the 2.7.0 package manager version, described here (package manager tab): https://docs.microsoft.com/azure/spatial-anchors/how-tos/setup-unity-project

And then I did the steps Bathur mentioned (https://github.com/microsoft/MixedRealityToolkit-Unity/issues/8839#issuecomment-732730691) to get it working. Thanks for the effort people!

I'm leaving this still open, as the steps in the tutorial won't be enough to reach a working solution.

ivatilca commented 3 years ago

Hi @mr0ng , yes here it's:

https://github.com/Pandalex1/MRTK-Azure

Many thanks in advance.

Hi, the link is no longer working. :(

omanuke commented 3 years ago

I encountered same error on Unity2019.4.19f and ASA2.71 and MRTK2.5. #8839 didn't solve. Additionally, I changed ScriptingBackend to IL2Cpp. I'm not sure why but this solved problem.

image

polar-kev commented 3 years ago

@mr0ng were there changes to the tutorial assets that would prevent this from working on older versions of MRTK?

stale[bot] commented 2 years ago

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

IssueSyncBot commented 9 months ago

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!