Visual Studio 2015 hybrid app - getting “EPERM, operation not permitted”

冷暖自知 提交于 2019-12-01 10:39:05
tlewis

I thought I'd chime in here with what I've done. The problem is that "platforms" is not checked into source, but it is still being marked as Read-Only. So the first time it builds it works and subsequent builds fail unless you do a clean solution.

What I've done is I remove the Read-Only flag before build.

Right click project, Unload Project. Right click, edit project file. At the top, add a target named BeforeBuild for example:

<Project ToolsVersion="14.0" DefaultTargets="BeforeBuild;Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Then at the bottom of the file where the targets go you can add a target like this:

<Target Name="BeforeBuild">
    <Exec Command="attrib -R &quot;$(SolutionDir)YourProjectName\platforms\*.*&quot; /S" IgnoreExitCode="true" />
</Target>

Check if the folder is Read Only, if it is - uncheck the "Read Only" property on the folder and select "Apply changes to this folder, subfolders and files"

I get the same exception when I use TFS with Cordova.

When I'm committing the folder become Read Only, that's a very annoying bug...

For me, the directory that the error message pointed to was just plain missing. Same IDE, same type of app.

It was looking for \GitHub...\myProjectName\platforms\windows\www

I manually added the dir (www) back in and the project ran fine. The IDE deletes that dir at the beginning of the build then throws the EPERM exception. Sure looks like a bug to me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!