的Visual Studio 2015的混合应用程序 - 让" EPERM,操作不允许" [英] Visual Studio 2015 hybrid app - getting "EPERM, operation not permitted"

查看:242
本文介绍了的Visual Studio 2015的混合应用程序 - 让" EPERM,操作不允许"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种荒谬的情况,我会很高兴听到究竟如何,你们处理吧:

I having kind of absurd situation and I will glad to hear how exactly you guys handling it:

我有一个混合应用项目时,Visual Studio 2015年科尔多瓦工具。里面,在资源文件夹中我的应用程序资源。整个项目,包括资源,是源代码控制下(TFS)。

I have a Hybrid App project, Visual Studio 2015 Cordova Tools. Inside it, under "res" folder I have app resources. The whole project, including resources, is under source control (TFS).

在生成过程中,资源文件被复制到.. \\ \\平台的Andr​​oid \\资源文件夹中。

During build, resource files get copied into "..\platforms\android\res" folder.

第一次,而该文件夹为空它成功 - 文件被复制原样(如只读,因为它们是源代码控制之下)。在此之后,接下来的构建过程中,它试图覆盖这些只读文件,并没有如预期 - 显示该信息的错误:EPERM,操作不允许'的的资源完整路径

First time, while the folder empty it succeeded - the files get copied as-is (e.g. read-only, since they are under source control). After that, during next build, it trying to overwrite these read-only files and failed, as expected - displaying that informative error: "EPERM, operation not permitted 'resource full path'.

我不明白这一点。资源必须得到源代码控制之下,所以我想和我一样的开发者99.99%会得到同样的问题。

I don't get it. Resources must be under source control, so I guess 99.99% of developers would get the same problem as I do.

我怎么错过?

感谢

推荐答案

我想我会附和这里我做了什么。问题是,平台是不是签入源代码,但它仍然被标记为只读。所以,第一次建立它的工作原理和后续构建除非你做一个干净的解决方案失败。

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.

右键单击项目卸载项目。点击右键,编辑项目文件。在顶部,添加一个名为目标 BeforeBuild 例如:

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>

这篇关于的Visual Studio 2015的混合应用程序 - 让&QUOT; EPERM,操作不允许&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆