Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 or GitHub 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.
I tried to write unit tests for my iOS app using this tutorial http://docs.xamarin.com/guides/ios/deployment,_testing,_and_metrics/touch.unit
But I can't add a reference from test project to devel project since it says "Cannot reference exe projects"
How to reproduce:
1. Create new iOS project (Master)
2. Create new iOS tests project (test)
3. Test project-> References->Edit References
4. Select "Project" in opened window.
Result: You can't select Master project due to "Cannot reference exe projects"
Expected: You can refer the Master project
It is kind a bug/or/feature issue but reference to the working project is pretty common way. I don't want to create dll every time I want to run tests.
That's an IDE restriction -> Xamarin Studio
OTOH, without the restriction, you'll likely hit another issue. The (unit test) application will try to register "AppDelegate" multiple time with the ObjC runtime. That will fail in some scenarios (e.g. the static registrar won't allow this when running on devices).
If you really want to avoid a .dll then you can reference the exe source files inside your unit test project.
exe projects are meant to produce native executables, not nunit testable assemblies.
*** Bug 12885 has been marked as a duplicate of this bug. ***
-> Xamarin.iOS issue
Probably should have explained why I reassigned.
The sample unit test project builds fine in XS and deploys to device, but all of the tests (seems to be only 1 test, actually) fail.
No idea why.
That test is failing because it can't find an image.
That image's Build Action is BundleResource - which means it will be copied to the .app directory of its project (the main project).
The unit test project only references AppProject.exe, and the image file isn't connected at all to the .exe, so the image will not be copied to the unit test .app directory.
You'll have to manually include the image (with the corresponding directory) in the unit test project for this to work.