Visual Studio output file permissions?

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:37:47
Maiku Mori

Wooho I finally figured this one out.

It's a bug in Windows 7 and likely in Windows Server 2008 (possibly 64bit versions only). It surfaces when you disable Application Experience service.

Re-enabling this service has fixed this problem for me.

You can't imagine how happy I am, this was making programming so frustrating as it's not just messing with VC, but any compiler and to top it off it's quite random.

A bit more info here as to why it's causing a problem.

List of other SO questions which seem to be related:

As mentioned above, the fix to this problem is to enable Windows Application Experience Service. Here's how to do this:

  1. Windows key + R
  2. Type "services.msc" in the window that pops up
  3. In the list, find "Application Experience."
  4. Double-click on this and change from "disabled" to "enabled"

It should work now! Worked for me :)

Source: http://www.techknowl.com/disable-unwanted-services-and-speed-up.html

Well, the file as it is created will be owned by the creator, if you are running Visual Studio as an administrator you are just stuck with it that way from an owner perspective.

Personally, unless you are using IIS for Web Applications I find myself running Visual Studio as a regular user more and more frequently, at least with VS 2010.

In regards to the issue where Visual Studio can not delete the file, I have seen this before with build errors, and sometimes if you have multiple projects that are referencing the same assembly. Your best bet there is try and track down the lock, and then you can either kill the lock, or restart Visual Studio.

I typically use Process Explorer (From SysInternals) to simply remove the handle on the file. (NOTE: this is NOT a "great" idea, but it works....)

no one give the right answer, so I close this question as a bug within operating system, not in Visual Studio, maybe the O/S is compromised since the file handle is owned by 'System' process (PID 4) and I can't release the file handle since it reporting the file handle is invalid using process explorer.

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