NCrunch can't build my Xamarin.Android project in VS 2013 Preview 1.
I get the following output:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues#0
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#1: Could not copy the file "Resources\Layout\LoginView.axml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#2: Could not copy the file "Resources\Values\Strings.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#3: Could not copy the file "Resources\Layout\SplashScreen.axml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#4: Could not copy the file "Resources\Values\Styles.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#5: Could not copy the file "Resources\Values\MvxBindingAttributes.xml" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#6: Could not copy the file "Resources\Drawable\Logo.png" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#7: Could not copy the file "Resources\Drawable\Icon.png" because it was not found.
..\..\..\..\..\..\..\..\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (564)#8: Could not copy the file "Resources\Drawable\splash.png" because it was not found.
It looks to me as though NCrunch isn't aware of the resource files needed to build this project, so it doesn't copy them to the workspace. You can probably fix this by including them with the 'Additional files to include' setting.
Are you able to share how these files are referenced? My assumption is that this isn't being done from the project file ... a resx perhaps?
I sent you the project file via the contact page.
Additionally, I sent you one from Xamarin.iOS. I think it has a few build actions on its own:
- BundleResource
- InterfaceDefinition
Finally: Wouldn't it be better if NCrunch would simply copy all files referenced from an attribute "Include" that belongs to a tag that is the direct child of a "ItemGroup" tag?
Maybe with a black list for well-known tags that shouldn't result in a copy operation like "BootstrapperPackage" or "ProjectReference"
Thanks Daniel - this gave me all the information I need :)
Broadly, there are two approaches .. either by whitelisting the files that are needed, or by blacklisting the ones that are not. Trial and error has proved that the whitelisting gives more predictable results with error messages that are generally easier to troubleshoot. Blacklisting can result in some very, very strange problems, and is also subject to certain limitations within MSBuild itself. When an item type is not deliberately considered by NCrunch, it is essentially an unknown - which can be dangerous to make any kind of assumptions about. MSBuild and project templates can unfortunately be full of surprises.
This will be included in the next maintenance release ... which at the moment I'm thinking will likely be around September. Because it's possible to work around it (i.e. with Additional files to include), it isn't really worth the risk of a separate release in short order, but it will definitely be in V1 :)