Bug 56734 - when creating asset catalogs in Xamarin Studio or Visual Studio for Mac can't open up asset catalogs in Visual Studio for Windows
Summary: when creating asset catalogs in Xamarin Studio or Visual Studio for Mac can't...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.5.0 (15.2)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 15.3
Assignee: Adrian Alonso
Depends on:
Reported: 2017-05-22 19:39 UTC by Aaron LaBeau
Modified: 2018-01-30 00:51 UTC (History)
14 users (show)

Is this bug a regression?: ---
Last known good build:

visual studio 2017 logs from PC (96.30 KB, application/zip)
2017-05-22 19:39 UTC, Aaron LaBeau
logs of visual studio for mac (16.63 KB, application/zip)
2017-05-22 19:43 UTC, Aaron LaBeau
screen shot of visual studio for mac (915.18 KB, image/png)
2017-05-22 19:43 UTC, Aaron LaBeau
screen shot of visual studio for pc (21.55 KB, image/png)
2017-05-22 19:43 UTC, Aaron LaBeau
cs proj for ios project (24.88 KB, application/octet-stream)
2017-05-22 19:44 UTC, Aaron LaBeau
CSProj from Visual Studio for Mac after adding images to asset catalog (11.35 KB, application/xml)
2017-05-22 20:54 UTC, Aaron LaBeau
sample project (350.40 KB, application/x-zip-compressed)
2018-01-15 22:14 UTC, Michael Shapiro

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Aaron LaBeau 2017-05-22 19:39:22 UTC
Created attachment 22367 [details]
visual studio 2017 logs from PC

Create new application in Xamarin Studio/Visual Studio for Mac.  Add in a few asset catalogs for launch image and app icons and a few other icons.  Check coded into TFS.  Check out code onto PC and try to modify the asset catalog in Visual Studio for PC - won't open the asset catalog file.  See attached logs for Visual Studio for PC, video showing this in Visual Studio for PC and version info for Visual Studio for Mac.
Comment 1 Aaron LaBeau 2017-05-22 19:43:06 UTC
Created attachment 22368 [details]
logs of visual studio for mac
Comment 2 Aaron LaBeau 2017-05-22 19:43:24 UTC
Created attachment 22369 [details]
screen shot of visual studio for mac
Comment 3 Aaron LaBeau 2017-05-22 19:43:41 UTC
Created attachment 22370 [details]
screen shot of visual studio for pc
Comment 4 Aaron LaBeau 2017-05-22 19:44:42 UTC
Created attachment 22371 [details]
cs proj for ios project
Comment 7 Aaron LaBeau 2017-05-22 20:54:57 UTC
Created attachment 22372 [details]
CSProj from Visual Studio for Mac after adding images to asset catalog
Comment 8 Jeffrey Stedfast 2017-05-22 21:09:41 UTC
What's this <InProject> tag? I've never seen that before.
Comment 9 Vincent Dondain [MSFT] 2017-05-30 15:12:29 UTC
Let me mark this as NEEDINFO since I don't know either what the <InProject> tag is for (VSWindows specific?).

Let us also bring VSW people on this to enlighten us.
Comment 10 Vincent Dondain [MSFT] 2017-05-30 15:40:37 UTC
Btw I tried to reproduce this bug and I couldn't.

I'm using the following environment on Windows: https://gist.github.com/VincentDondain/895b57b6b4a434ae4aac07de3797bb35

and this one on the Mac: https://gist.github.com/VincentDondain/394de839639c565676721d86b8cf808f

I tried with this sample: https://github.com/xamarin/ios-samples/tree/master/ios10/IceCreamBuilder

The csproj for the sample doesn't have the <InProject> tags. When opening it in Visual Studio Windows the IDE adds this new tag and it's able to open the asset editor just fine.

When going back to Visual Studio for Mac, this tag seems to be ignored.
Comment 12 Aaron LaBeau 2017-05-30 16:13:43 UTC
I can do a video and upload it to You Tube along with uploading a full project to github tonight of this happening if you like.  It's pretty much every time and get's worse if you create a new asset catalog in Windows and then try to use it on the Mac VS and then go back to Windows.  We do this a lot.
Comment 13 Vincent Dondain [MSFT] 2017-05-30 16:16:44 UTC
I totally trust you this is happening (: (so not sure we need a video) however a test case as well as your version information would definitely help.

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).
Comment 14 Adrian Alonso 2017-06-14 21:52:56 UTC
Hi Aaron,

Is the catalog named as "Assets"? Could you please try to rename it to anything else and check if you are able to open it in VS? I'm investigating the issue and so far I could reproduce the issue if the catalog name is "Assets".

Comment 18 Brian Hager 2017-12-12 13:21:53 UTC

I have the exact same issue and my catalog name is Media. 

Is this bug still actively being worked? Everyone who checks out our project can not edit the catalog.

Comment 19 Brian Hager 2017-12-12 13:23:27 UTC
I am actually having this issue on Visual Studio for Windows. Using Windows 10. Once the catalog is created and the project is closed and reopened, the asset catalog is not editable.

Comment 20 John Miller [MSFT] 2017-12-13 15:29:59 UTC
Hi Brian,

It sounds like the issue you are having is a little different since it's all in VS on Windows. I was not able to reproduce a problem in VS 2017 with the latest 15.5.1 release. If you are having the issue with the latest versions please file a new issue via the Help > Report a Problem menu in Visual Studio and include the steps you are taking to reproduce the problem. 

Comment 21 Brian Hager 2017-12-13 16:28:20 UTC
When double clicking the Asset catalog in VS 2017 on Windows 10, latest release of Xamarin (updated yesterday), the previewer does not open.  From the project file (also, when adding the assets as part of the project, when someone else checks out the files from TFS, they get the assests, but if the alter the project in anyway, the project file ends up with Visible to false and the resourses are no longer part of the project). Very buggy behavior.

    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\Contents.json">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo120.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo152.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo167.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo180.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo20.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo29.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo40.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo58.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo60.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo76.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo80.png">
    <ImageAsset Include="Resources\Media.xcassets\AppIcons.appiconset\FHL_Logo87.png">
    <ImageAsset Include="Resources\Media.xcassets\LaunchImages.launchimage\Contents.json">
Comment 22 John Miller [MSFT] 2017-12-13 18:14:13 UTC
Hi Brian,

Would you report this issue, and the details of the scenario via the Help > Report a Problem? This bug is not the best place to discuss a new issue and I want to make sure we get eyes on it ASAP. 

Also, after you log it there, attach the logs from the Help > Xamarin > Zip Xamarin Logs (after you try and open the Media assets). That might contain some more information on the problem. Thanks!
Comment 23 Michael Shapiro 2018-01-15 18:10:39 UTC
When is this going to be fixed? I am so tired being your beta tester, Microsoft. It is so very reproducible if only you read what people are saying here... 
The status says it is fixed.... really?
Comment 24 Adrian Alonso 2018-01-15 20:30:51 UTC
I'm sorry for the inconvenience you're experimenting. Some answers based on what we could check so far:

@Brian Hager: We changed the usage of <InProject>false</InProject> with <Visible>false</Visible> for compatibility with Visual Studio for Mac. I understand that after getting the source code you will end up with the modified file, but after the changes are checked in you should not get the modified file behavior anymore. And those files/resources should not visible in the Solution Explorer by design.

@Michael Shapiro: We're not being able to reproduce the issue so far. It would be great if you could upload a simple solution/project reproducing the issue and we will take a look at it asap.

Again, sorry and we will follow up this issue.
Comment 25 Michael Shapiro 2018-01-15 20:33:55 UTC
I will be uploading the project soon.
Comment 26 Michael Shapiro 2018-01-15 22:13:17 UTC
Adrian - I think I know what is happening. Your comments above "... those files/resources should not visible in the Solution Explorer by design..." helped me find something interesting. In short - Asset Catalog is not opening because the resource folder was manually included  in he project. But the reason it was manually included in the project is to fix the bug that prevents images being selected in the storyboard thus rendering storyboard useless. Please follow the reproduction steps below:
Windows 10, Visual Studio Professional 2017 Version 15.5.3

Attaching: sample project ImageCatalogIsBroken.zip
Link to the video will be provided in the next post (uploading now)

1) Create/Open simple project with storyboard and image asset catalog. Name Asset Catalog “Images”.

2) In the Solution Explorer double click on Assets > Images. Images.xcassets designer will open.

3) Add a few image sets.

4) Close Images.xcassets designer. Close project. Reopen project.

5) In the Solution Explorer double click on Assets > Images. 
Images.xcassets designer will open AGAIN! So far so good.

6) Open storyboard designer. Place UIImageView on a ViewController. Select ImageView and go to Properties.

7) Click the Image drop down. 
HERE IS THE BUG: Instead of list of available images a Windows Explorer window opens up. Yes, I understand this bug is not what we are all complaining here about... but read further. To fix THIS BUG I need to INCLUDE files under Resources folder in the project.

8) In the Solution Explorer click “Show All Files”

9) Go to Resources > Images.xcassets folder. Observe the folder is NOT included in the project. Right click the folder, select “Include In Project”

10) Save and close the project. Reopen the project.

11) Open storyboard designer. Navigate to the view with UIImageView. Select it. Go to the Properties.  Click the Image drop down. MAGIC!!!! List of images NOW APPEARS as it should have been in the first place!!!!!!!!!!!!!!!!!!!!

12 )Now is the BUG: In the solution Explorer go to Assets > Images. Right click on Images, select Open... nothing... nothing is happening... Open command is being ignored. WHY? Probably because the Images.xcassets folder is now part of the project. But without it being included in the project my entire storyboard is incapable of working with image!!!!!!!!!!!!!!!!!! How can I design if the storyboard is useless??? 

QUESTION: WHY do I have to choose between either working storyboard or working image catalog???? Seriously?
Comment 27 Michael Shapiro 2018-01-15 22:14:21 UTC
Created attachment 26085 [details]
sample project
Comment 28 Michael Shapiro 2018-01-16 03:06:49 UTC
@Adrian - The video showing the above steps is here: https://youtu.be/jQJGigHG65M
Comment 29 John Miller [MSFT] 2018-01-16 14:45:45 UTC
I am able to reproduce this with 15.5.3, which is the latest released version. 

I am not able to reproduce this with 15.6 Preview 3. @Adrian, please confirm. This may no longer be an issue as of 15.6 P3.
Comment 30 Michael Shapiro 2018-01-16 14:48:56 UTC
@John - in 15.6 Preview3 -  are you able to select images in the story in the Images drop down??? It woudl be awesome it this bug is finally fixed.. it's been there since December.
Comment 31 John Miller [MSFT] 2018-01-16 15:00:14 UTC

Yes. I followed your steps to reproduce the issue and I can with 15.5.3. When I follow the same steps in 15.6 P3, I don't have the issue. I have not tried 15.6 P2 yet. 

Note* If you create an ImageSet, but don't add any images to it (All ImageSets and AppIcon sets are empty) then the Windows Explorer still opens. 

But if you include at least one image in an image set, the image sets with images appear in the drop down as expected.
Comment 32 Michael Shapiro 2018-01-16 15:13:56 UTC

Is there an eta for public release yet?

Unfortunately images do not appear in the drop down in my projects even if images are added t the catalog in AppAcon or any other image set. It behaves exactly as it is show on the video provided earlier. So, the fix is very much appreciated and needed.
Comment 33 Phil Carbone 2018-01-25 15:32:12 UTC
We had someone create the Asset Catalog in VS 2017 (v.15.5.4 Windows) and then commit to Git. Once it was pulled down on another computer with the same version of Visual Studio couldn't open the the Asset Catalog at all. If you double-click it, it does nothing.
Comment 34 Brian Hager 2018-01-26 13:29:24 UTC
Same issue as Phil exactly. What happens is the project file XML gets messed up. I can fix the issue if I manually correct the XML in the project file.
Comment 35 Brian Hager 2018-01-26 13:30:29 UTC
Sounds to me like the exact same issue described in the original bug report.
Comment 36 John Miller [MSFT] 2018-01-26 15:32:11 UTC
@Phil, @Brian

I believe the issue where a project created in VSMac first causes the Asset Catalogs to not open in VS on Windows resolved in 15.6 Preview 3, which is available now if you would like to try the Preview. If not, it will be available when the 15.6 version releases. 

Comment 37 Phil Carbone 2018-01-26 18:12:33 UTC
Hi @John,

We created our Catalog in VS 2017, in Windows. The exact version we used was v.15.5.4.

We have this issue after committing to source control. I was able to work around the issue by doing the following (assume my original catalog is called Assets):

So in VS, I can't open "Assets", so...
1) I browse to the project folder and into the 'Resources' folder. (Using Windows file explorer, not in Visual Studio)
2) I see one folder (plus any other assets I have in there):
3) I rename the folder to 'Assets.xcassets.old'
4) Back in VS, I delete the old Assets catalog from the project.
5) I create a new Catalog called 'Assets'
6) I browse back to the project folder and into the 'Resources' folder. (Using Windows file explorer, not in Visual Studio)
7) I now see two folders (plus any other assets I have in there):
8) I move the contents of 'Assets.xcassets.old' into 'Assets.xcassets'
9) I delete the 'Assets.xcassets.old' folder
10) I restart VS and go back into the project
11) Now my 'Assets' catalog works and I can edit it
Comment 38 Phil Carbone 2018-01-26 18:17:34 UTC
Oh, and our project was created in an older version as VS, but it was on Windows as well.
Comment 39 Phil Carbone 2018-01-30 00:51:06 UTC
Shockingly, our issue isn't related to the project file being different. We used BeyondCompare against the entire solution folder to look for diffs between a working copy and a non-working copy. The only fiesl that were different were the ".suo" files