error: Could not load file or assembly 'UnityEngine.Purchasing In the UWP solution

error: Could not load file or assembly 'UnityEngine.Purchasing In the UWP solution

In the editor and in android apk everything is fine.
The error happens in the file MainPage,xaml.cs at the expresion appCallbacks.SetBridge(_bridge);

I’m just testing in local without configure anything on the Windows Dev Center

The manual says that: This removes the need to configure anything on the Windows Dev Center or communicate with the the Windows Store via the app for initial integration testing.

The UnityEngine.Purchasing.dll is in the solution explorer pointing to the file in the directory \Unprocessed as the others dll’s.
You can see others dll’s and pdb’s in the output directory but not the Purchasing (dll and the pdb)

The complete error is:

System.TypeInitializationException: The type initializer for ‘WinRTBridge.WinRTBridge’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘WinRTBridge.TypeInformation’ threw an exception. —> System.IO.FileNotFoundException: Could not load file or assembly ‘UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’. El sistema no puede encontrar el archivo especificado.
at UnityEngineInternal.BootstrapHelpers.FillTypeMaps0(Dictionary2 , List1 )

Ok. Nice to see all working again.

Unity don’t copy the new dll’s in the uwp solution if you build over an already cerated directory.

Usually buiding to an existing solution (directory) is preferable if you have customized the solution and added code manually wich is the case if for instance, you use unity advertising, so the build doesn’t overwrite mainpage and so on.

But if the project has changed the dll’d it uses, adding iap for instance, the build doesn’t add these new dll’s.

Solution: buid to a new directory and re create the project customization in VS (nuget , Microsoft Advertising SDK , icons …)