Reputation: 908
I get "Sharing violation on path" error whenever I try to build a VS project on macOS if the project is not in Users/../projects folder. I keep my work files on separate drive (exFat) which is perfectly accessable and works fine both under windows and macOS.
I assume it happens because of some permissions' violation but I am very new to macOS and can't figure it out.
macOS version - Mojave
Upvotes: 1
Views: 906
Reputation: 11
Fixed in the way like kinhoon said, thanks. One useful side note: we can use "Home" env variable instead of hardcoded users/<user_id> folder
<IntermediateOutputPath Condition=" '$(OS)' == 'Unix' ">$(Home)\path_to_folder\$(Platform)\$(Configuration)</IntermediateOutputPath>
Upvotes: 1
Reputation: 1
I found another solution, which you can still keep your code in exFAT. https://xamarin.github.io/bugzilla-archives/15/15093/bug.html
The solution in the above link suggests to manually edit the project file and put the following line into the build configuration to put the intermediate files in your Mac volume:
<IntermediateOutputPath Condition=" '$(OS)' == 'Unix' ">\Users\your_user_id\path_to_folder\$(Platform)\$(Configuration)</IntermediateOutputPath>
Note that you need to replace your_user_id
and path_to_folder
in the line above with your own values specific to your Mac installation.
The best is to put the line in every platform and configuration.
You can actually put it somewhere other then Users
folder, but that seems to be the best place to put.
Upvotes: 0
Reputation: 908
Looks like it's a bug related to the way OS or VS handles writing on file systems FAT and exFAT.
https://www.feval.ca/posts/fixing-cs2012/#fn:1
Upvotes: 0