thinksquirrel/asset-store-batch-mode

AssetServer is replaced with Packager & AssetsItem is deprecated in the new AssetStoreTools

clivecrous opened this issue · 5 comments

After cleaning assets (like the asset store tools) and redownloading it within 2017.1.0f3 and also then, after than, re-installing asset-store-batch-mode, the error presents as follows:

TypeLoadException: Could not load type 'UnityEditor.AssetServer'.
  at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)
  at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) [0x00028] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:398 
  at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:381 
  at AssetServer..ctor () [0x0001f] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:644 
  at AssetServer..cctor () [0x00001] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:638 
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for AssetServer
  at AssetStoreBatchMode.GetGUIDS (.Package package, System.String localRootPath) [0x00050] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:411 
  at AssetStoreBatchMode.CheckContent (.Package package, System.String localRootPath) [0x00063] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:384 
  at AssetStoreBatchMode.UploadAssetStorePackage (System.String username, System.String password, System.String packageName, System.String rootPath, System.String[] mainAssets, Int32 loginTimeout, Int32 metadataTimeout, Int32 uploadTimeout, Boolean skipProjectSettings) [0x00248] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:223 
  at AssetStoreBatchMode.UploadAssetStorePackage (System.String[] args) [0x001f2] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:119 
  at AssetStoreBatchMode.UploadAssetStorePackage () [0x00006] in /Volumes/OSX Dev/DarkArts Studios/Unity Editor Extensions/Screenshot Creator/screenshot-creator.visual-studio-solution-release/Unity Projects/2017.1.0f3/Assets/AssetStoreTools/Editor/asset-store-batch-mode/AssetStoreBatchMode/AssetStoreBatchMode.cs:49 
 
(Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs Line: 398)

executeMethod method AssetStoreBatchMode.UploadAssetStorePackage threw exception.
 
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 189)


Aborting batchmode due to failure:
executeMethod method AssetStoreBatchMode.UploadAssetStorePackage threw exception.

Strangely I've just experienced this error in a different project, on Unity 5.0.0f4, where the first project (as per previous log trace from 2017.1.0f3) worked fine on 5.0.0f4.

I'm beginning to think this might be an issue with the latest version of the AssetStoreTools perhaps rather than an issue with Unity Versions.

Hm, that is likely. We've been able to get this working in 2017.1.0 without any problem, but with an older AssetStoreTools version. Unfortunately since the APIs are mostly internal any changes in the Asset Store Tools are likely to break stuff. Will take a look and see what was shuffled around.

I am attaching a very dirty hack that gets this working with the new Unity Asset Store Tools. I'm not happy about how it's constructed, but I needed something quickly for my own usage today. I hope this at least works as a guide or a starting point to what's changed.

TLDR:

  1. AssetServer -> Packager
  2. AssetsItem, as a type, is deprecated

(sorry the file is .txt, github wouldn't let me upload .diff )

dirty-hacky-fix.diff.txt

PR with a fix is up (#2)