如何从阻止访问文件,然后扔访问停止asp.net否认构建错误? [英] How can I stop asp.net from blocking access to files then throwing access denied errors on build?

查看:150
本文介绍了如何从阻止访问文件,然后扔访问停止asp.net否认构建错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我多次得到建设大致如下的行错误:

I repeatedly get build errors along the lines of the following:

无法进行以下项目可运行:
< ; 项目名称>理由:访问路径'C:(.net框架,版本= v4.6.1)\< 的根路径> \src\< 项目名称> \bin\Debug\\\
et641\win7-64x\< ; 一些DLL,EXE,配置,无论>'被拒绝

Failed to make the following project runnable: <project name>(.NETFramework,Version=v4.6.1) reason: Access to the path 'C:\<path from root>\src\<project name>\bin\Debug\net641\win7-64x\<some dll, exe, config, whatever>' is denied.

我正从其他文件夹类似的错误,但把他们从源头控制的帮助了(见下文)

I was getting similar errors from other folders but taking them out of source control helped (see below)

有时手动将在资源管理器中的文件夹>右键点击>属性>取消只读工程创建成功,但那么无论VS或TFS再次锁定该文件和相同的生成错误返回

Sometimes manually going to the folder in Explorer > right click > properties > uncheck "read only" works for a successful build but then either VS or TFS locks the file again and the same build error returns

在特别的时刻,都有两个。 dll文件被添加到被重复设置为只读的bin和我必须手动修复,在文件浏览器后重建。 AFAIK这些都不是在源头控制,但由同一个名字的解决方案中的另一个项目中的文件,并且不改变被选中。

In particular at the moment there are two .dll files being added to the bin which are repeatedly set to "read only" and I have to manually fix that in file explorer upon rebuild. AFAIK these are not in source control, but the files in another project within the solution by the same name are checked in and not changing.

这可能是与我使用的是事实的 asp.net核心RC2 这是不是官方,再加上我是 角2 RC1 ,但我不认为这是相关的。

It may have something to do with the fact I'm using asp.net Core RC2 which is not official yet, plus I'm pairing it with Angular 2 RC1 but I don't think that's related.

有一种说法是,它有事情做与TFS因为错误似乎还没有启动,直到我把项目的源代码控制之下。

One theory is that it has something to do with TFS since the errors don't seem to start until I put the project under source control.

我已经看到了一些关于堆栈溢出类似的问题,但没有答案,即使是开始解决我自己的重复问题。

I've seen a number of similar questions on Stack Overflow but no answers that even begin to resolve my own repetitive problem.

提示:我得到同样与transpiled .TS>的.js文件,并把他们从源头控制似乎有帮助,但我没有看到在源bin文件夹在所有的控制(当然这是隐藏在Solution Explorer中,我看不出有什么选项,在源代码管理资源管理器取消隐藏,所以不知道它的存在,在所有...)

HINT: I was getting the same with transpiled .ts > .js files and taking them out of source control seems to have helped but I don't see the bin folder in source control at all (of course it's hidden in the solution explorer and I see no option to unhide in source control explorer, so not sure if it's there at all...)

推荐答案

这个问题似乎与.NET的核心,或者说与TFS TFS反正整合。

The problem appears to be TFS integration with .net Core, or something with TFS anyway.

解决方案通常是颠覆TFS,这是不实用,不应该是必要的。这里有几件事情我已经做了...

The solution is generally to subvert TFS, which is unwieldy and should not be necessary. Here are a few things I've done...


  • 使用.tfignore(类似的.gitignore),以防止某些文件(例如。//using%20a%20.tfignore%20file%20(太多%20like%20.gitignore:作为transpiled .TS =>的.js)在被检查这并不是没有采取措施怪异的像安装此...

  • 简单检查后仍锁定的任何文件给我的麻烦(见我的回答我的其他问题的here

  • 几乎任何其他的策略,以防止从TFS签入文件,它不应该(有时坏,只是让他们在排除更改列表中,直到别人需要访问,在这一点我必须将它们全部删除和/或撤消所有的变化)

所有的一切,我真的希望微软获得了大部分或全部我遇到的时候.NET核心制定了可怕的错误正式发布。在这一点上,我非常想成为一名Node.js的开发者。

All in all, I really hope Microsoft gets most or all the terrible bugs I've encountered worked out by the time .net Core is released officially. At this point I'm sorely tempted to become a node.js developer.

这篇关于如何从阻止访问文件,然后扔访问停止asp.net否认构建错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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