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 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.
There is currently no good way to control what is copied to MacOSX host, and where/how it is copied.
Some related issues are bug 23164, as well as bug 23633.
Currently, the only way to get a file copied is to have it as a BundleResource or Content.
However, doing so will also get it copied to the .app bundle (which is sometimes not wanted -- i.e. native libraries).
Also, it will be copied in a path relative to MacOSX root folder (relative path will go out of the MacOSX build folder sandbox).
What would probably be a good way to avoid all those issues would be to:
1/ Only use sandboxed path on MacOSX host (don't copy files directly in mtbs/builds/ProjectName/GUID/MyFile.txt but instead use mtbs/builds/ProjectName/GUID/C:/DEV/Project1/MyFile.txt). That would unify all paths on MacOSX side.
2/ Respect CopyToOutputDirectory (if CopyToOutputDirectory == None, then copy source file to MacOSX host (taking into account the <Link>), so that it can still be used it but it won't be embedded in .app).
3/ Remove <LogicalName> (or keep it internal). Instead, Link should be used (which reverse everything: you create proper hierarchy in your project, and source files could be in another folder). For now we have to use LogicalName to compensate Link issues (and remap everything the opposite way).
I also noticed some issues when using Link, and also when using full path that contains ".." elements (such as <Link>C:\DEV\Project1\..\Project2\content.txt</Link>). It seems that some GetFullPath might be missing.
Let me know if you need to discuss specific details.
What exactly is the use case you're trying to make work here? It's not clear to me why you'd want to copy files to the Mac if they're not going to end up in the bundle.
If it's just for native libraries, IMO we'd be better off improving the existing NativeReference build action.
Main use case was for
- bug 23633 would need to be fixed somehow (can apply to many other things that you copy in the root folder instead of sandboxing).
- also, if we could just use Link instead of opposite LogicalName would help.
Native Linking was just another side effect that might have been fixed easily that way too, but having a NativeReference that works well is probably better. However that wouldn't help the other use cases
*** Bug 23164 has been marked as a duplicate of this bug. ***
Setting CopyToOutput should copy the files in the output of the mac now too.
Created attachment 8642 [details]
I have try to verify this issue, as this issue is duplicate of bug 23164, so I have used test sample attached in comment3 of bug 23164.
after setting copytooutput "Copyalways" in properties of libmysqlclient.a file it gives same build error again and again.
However if we manually copy the file to the mac build host then it builds successfully.
Hence reopening this issue
I have checked this issue on following environment :
Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Installed Version: Professional
Xamarin 220.127.116.11 (f218ea340ead32747337ce247572983dbb7f3c37)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 18.104.22.168 (df7ddb73c75084816b9702208e692a635f976122)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.iOS 22.214.171.124 (345e4705a2a1117897f6b66b555eaa4e41462924)
Visual Studio extension to enable development for Xamarin.iOS.
I have checked this issue with attached sample in comment 6, and observe that build error still occurring with XVS 3.8.135 when we select "Copyalways" in properties of libmysqlclient.a file.
screencast : http://screencast.com/t/OaPmOHqzedjD
However when we build attached project, file 'libmysqlclient.a' is appearing in mac build host as shown in screencast : http://screencast.com/t/WtTksPD4Vs
but file location is different .
Using X.iOS 126.96.36.199 + Xcode 6.1
Hence reopening this issue.
I have checked this issue and this issue is working fine now as shown in screencast : http://screencast.com/t/lwbifWYWO
Hence closing this issue.
Using XVS 3.8.145
I still got this issue using Xamarin for VS 3.8.150, hence reopening.
Oops, I made a mistake. I did not set Copy to Output directory. Resolving again. :-)
Changing the status to Verified as per Comment#11