简体   繁体   中英

Can't build a VS project on macOS

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

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>

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM