- Home /
Package directory not found for DataContractSerialization
Anyone know what might be causing this error? I still seem to be able to create and run projects, but I worry I might be missing some functionality somewhere...
System.Exception: Package directory not found: "C:\Users\me.nuget\packages\System.Private.DataContractSerialization\4.1.1". at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve () [0x000dd] in :0 at AssemblyUpdater.Core.AssemblyUpdaterContext.AddFrameworkFolderToSearchPath (Mono.Cecil.AssemblyDefinition assemblyDefinition, Mono.Cecil.DefaultAssemblyResolver resolver, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x000eb] in :0 at AssemblyUpdater.Core.AssemblyUpdaterContext.ReadAssembly (System.String assemblyPath, APIUpdater.Framework.Log.IAPIUpdaterListener listener, System.IO.FileAccess mode, System.String[] searchPaths) [0x00086] in :0 at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, APIUpdater.Framework.Configuration.IConfigurationProvider configuration, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x0002b] in :0 at AssemblyUpdater.Core.AssemblyUpdaterContext.From (System.String assemblyPath, System.String[] assemblySearchPaths, AssemblyUpdater.Core.UpdaterMode mode, APIUpdater.Framework.Log.IAPIUpdaterListener listener) [0x00001] in :0 at AssemblyUpdater.Application.Program.CheckForObsoleteAPIUsage (AssemblyUpdater.Application.CommandLineSpec config) [0x00013] in :0 at AssemblyUpdater.Application.Program.Main (System.String[] args) [0x00057] in :0 UnityEditor.Scripting.APIUpdaterHelper:DoesAssemblyRequireUpgrade(String)
Answer by DerrickLau · Sep 23, 2017 at 12:22 AM
I got the same error...What I believe it means is that Unity3D cannot find the assembly your code is supposed to reference, as it was expecting a DLL in that directory. Like you I'm trying to create a .NET standard assembly that uses the [DataContract] and [DataMember] attributes, and compiling to .NET standard 1.4, hence the need to download that particular NuGet package.
However, I have no idea how to resolve the problem. I cannot find that assembly (System.Private.DataContractSerialization) anywhere!
I got rid of the error by adding the following NuGet package to the Visual Studio project using the [DataContract] and [Data$$anonymous$$ember] decorators: System.Private.DataContractSerialization (4.3.0).
Try that.