Bug 60124

Summary: Could not load asset catalogs
Product: Visual Studio Extensions Reporter: Jens-Christian <jens.christian>
Component: iOSAssignee: Emanuel <ema>
Status: VERIFIED FIXED    
Severity: critical CC: ema, jas, joe, kzu, luis.aguilera, mono-bugs+bugzilla, paul.dipietro, pierce.boggan, rohanbethune, v-paambh
Priority: Highest    
Version: 4.7.0 (15.4)   
Target Milestone: 15.4 SR2   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Full log

Description Jens-Christian 2017-10-11 10:41:50 UTC
Created attachment 25269 [details]
Full log

After updating to Visual Studio Professional 15.4.0, I'm uable to edit assets catalogs, and my media is missing in the application.

In the logs I found this (full log is attached)
Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogFlavoredProject|Error|0|Could not load asset catalogs
System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.IOS.AssetCatalog.ItemSpecs.get_AllSpecs() in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.Interfaces\AssetCatalog\Model\ItemSpecs.cs:line 617
   at Xamarin.VisualStudio.IOS.AssetCatalog.ItemSpecs.FindSpec(XCassetItem image) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.Interfaces\AssetCatalog\Model\ItemSpecs.cs:line 685
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.<>c__DisplayClass32_1.<AddDefaultItems>b__1(XCassetItem i) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.<>c__DisplayClass32_0.<AddDefaultItems>b__0(XCassetItem x) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.AddDefaultItems(XCasset xcasset, XCasset defaultXCasset) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.LoadCatalogs() in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 145
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogFlavoredProject.<OnAggregationComplete>b__8_0() in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\Project\AssetCatalogFlavoredProject.cs:line 57
Comment 1 Jose Gallardo 2017-10-12 13:38:34 UTC
Hi Jens,

We've already found the root cause for this issue, and we do have a patch for it.
Please let us prepare a patched version so we can share it with you and you can confirm it actually works in your case.

We'll let you know as soon as that patched version is ready.

Thanks!
Comment 2 rohan bethune 2017-10-20 21:31:08 UTC
Hi

We also have the issue since updating to 15.4.1 , and happens periodically during connection.

Could not load asset catalogs
Connecting to the Server...
Starting connection to 10.211.55.2...
Couldn't connect to MACSERVER Please try again.
Disconnected from the Server MACSERVER (10.211.55.2)
Visual Studio couldn't connect to MACSERVER (10.211.55.2).

This happens when we start VS Enterprise and try and load our solution and connect to our mac build host - The only remedy we have found is to shutdown our VM (W10) and our MAC and restart again.

Stack trace in Logs
_____________________
Xamarin.VisualStudio.MsBuild.ProjectBuildTracker|Error|0|Cannot start build tracking. Project is null.
Xamarin.VisualStudio.MsBuild.ProjectBuildTracker|Error|0|Cannot start build tracking. Project is null.
Xamarin.VisualStudio.MsBuild.ProjectBuildTracker|Error|0|Cannot start build tracking. Project is null.
Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogFlavoredProject|Error|0|Could not load asset catalogs
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.IOS.AssetCatalog.ItemSpecs.FindSpec(XCassetItem image) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.Interfaces\AssetCatalog\Model\ItemSpecs.cs:line 686
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.<>c__DisplayClass32_1.<AddDefaultItems>b__1(XCassetItem i) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.<>c__DisplayClass32_0.<AddDefaultItems>b__0(XCassetItem x) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.AddDefaultItems(XCasset xcasset, XCasset defaultXCasset) in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 162
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogManager.LoadCatalogs() in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\AssetCatalogManager.cs:line 145
   at Xamarin.VisualStudio.IOS.AssetCatalog.AssetCatalogFlavoredProject.<OnAggregationComplete>b__8_0() in C:\d\lanes\5156\fe36becf\source\xamarinvs\src\Core\VisualStudio.IOS.AssetCatalog\Project\AssetCatalogFlavoredProject.cs:line 57
Xamarin.VisualStudio.Android.ContinuousPlayerDeviceProvider|Information|0|Start()
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Connecting to the Server...