Open ermau opened 5 years ago
It appears you can work around this by creating ImageAsset items in your csproj:
<ImageAsset Include="Assets.xcassets\FooColor.colorset\Contents.json" />
<ImageAsset Include="Assets.xcassets\BarColor.colorset\Contents.json" />
Test Project: ColorAssetTestC.zip
It appears the new (from Xcode) Contents.json
are not read when calling actool
IOW "only" the original ones (from the template) are used.
It seems we should be scanning the directory to find all of them and build the list from this (instead of storing them inside the .csproj).
@jstedfast does that sounds right ?
There's different two issues.
The VS4Mac addin does not read the files either, so what's added by Xcode is not shown when opening the asset editor. -> https://github.com/xamarin/xamarin-macios/issues/5359
The (ms)build does not consider what's not in the .csproj - which should not depend on the IDE since a bot would use msbuild directly.
We use the .csproj because the IDE allows users to "Remove from Project" instead of "Delete from Disk", so we can't assume that just because there's a directory or a file on disk that it should be included in the build. This also had the benefit of fixing VS Windows which needed to know which files to copy over to the Mac.
I spent 4 days to find any solution for macOS project to have color assets for light and dark mode. Finally, it worked for me. Instead of using hex-color codes I used rgb. Now the VSM opens the Assets.xcassets in the IDE
Steps to Reproduce
Assets.xcassets
in XcodeNSColor.FromName
Expected Behavior
The color loads. I'd also expect the color set to appear in the VSM editor.
Actual Behavior
The
NSColor
is unresolved and the set does not appear in the VSM editor.Environment