没有足够的存储空间来完成此操作
环境:
- Visual Studio Ultimate 2010
- Windows XP
- 使用 .NET 4.0 的 WPF 桌面应用程序
我们有一个播放视频的桌面应用程序。该视频是项目的一部分,该项目已打包到安装程序中。构建安装程序项目时偶尔会显示此错误消息:
没有足够的存储空间来完成此操作
如果我重新启动 Visual Studio,它就会工作。
有办法避免这种情况吗?有没有更好的方法将视频打包到安装程序中?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
就我而言,我执行代码的服务器无法处理我的并行代码。
通常我会运行如下所示的设置,
引入一个变量并允许将内核锁定为 1(产生如下所示的代码),为我解决了这个问题。
In my case the server I was executing the code on couldn't handle my parallelized code.
Normally I'm running a setup like the following
Introducing a variable and allowing lockdown of cores used to 1 (resulting in code like the following), resolved this issue for me.
对我来说关键是:
我们在应用程序中嵌入了一个巨大的数据库模板(测试已填充大量数据)。自从正确删除嵌入式资源并将数据库移动到资源文件夹后,我还没有看到此问题出现。
The key for me:
We had embedded a huge database template (testing had filled it with lots of data) into the application. I have not seen this issue arise since removing Embedded Resource boils properly and moving the database to a recourse folder.
我通过删除或禁用(排除)大尺寸的 *.rpt 文件来解决此问题;并且我已经优化了我的报告!
My fix this problem with delete or disable(exclude) the *.rpt files that have large size;and I've optimize the my reports!
我回答晚了,但可能对其他人有用
就我而言,只需重新启动 Visual Studio 即可解决问题
I am late to Answer but may be useful for others
In my case just restarting Visual Studio fixes the problem
当构建过程需要大量 RAM 内存但无法获取时,通常会发生这种情况。由于重新启动 Visual Studio 可以解决问题,因此很可能这也是您的情况。
尝试关闭一些正在运行的应用程序。您还可以尝试向计算机添加更多 RAM 或增加页面文件。
This usually happens when the build process needs a lot of RAM memory and cannot get it. Since restarting Visual Studio fixes the problem, most likely it also your case.
Try closing some of the running applications. You can also try adding more RAM to your machine or increasing the page file.
我在 Windows XP 中的 Visual Studio 2010 中尝试编译 C# 解决方案时遇到了这个问题。一个项目有相当数量的嵌入式资源(生成的程序集的大小约为 140MiB),并且我无法编译该解决方案,因为我得到了
我的构建输出中的此操作错误。
这个问题的答案都没有帮助,但我确实找到了“没有足够的存储空间来完成此操作”,作者:ScottBurton42 在social.msdn.microsoft.com上。它建议将
3GB
开关添加到Boot.ini
文件中,并使devenv.exe
能够识别大地址。将3GB
开关添加到我的Boot.ini
文件中对我来说很有效(我认为devenv.exe
对于 Visual Studio 2010 及更高版本是 < em>已经大地址感知)。我的回答是基于这个答案。
解决方案一:设置
/3GB
Boot.ini
开关页面内存支持和 Windows 操作系统 说:
在 Windows XP 中,可以通过转到
/3GB
在 MSDN 上切换说:重新启动机器将使设置生效。
解决方案 2:使
devenv.exe
大地址感知:打开 Visual Studio 命令提示符(或开发人员命令提示符,具体取决于 Visual Studio 的版本)
键入并执行以下命令行:
其中
{path}
是devenv.exe
的路径(您可以通过转到 Visual Studio 快捷方式的属性找到它)。这将允许 devenv.exe 访问 3GB 内存而不是 2GB。
I came across this question when trying to compile my C# solution in Visual Studio 2010 in Windows XP. One project had a fair number of embedded resources in (the size of the resultant assembly was ~140MiB) and I couldn't compile the solution because I was getting the
error in my build output.
None of the answers on this question helped, but I did find an answer to "Not enough storage is available to complete this operation" by ScottBurton42 on social.msdn.microsoft.com. It suggests adding the
3GB
switch to theBoot.ini
file, and makingdevenv.exe
large-address aware. Adding the3GB
switch to myBoot.ini
file was what worked for me (I thinkdevenv.exe
for Visual Studio 2010 and above is already large-address aware).My answer is based on that answer.
Solution 1: Set the
/3GB
Boot.ini
switchThe page Memory Support and Windows Operating Systems on MSDN says:
In Windows XP, the
Boot.ini
file can be modified by going toThe page on the
/3GB
switch on MSDN says:Restarting the machine will then cause the setting to take effect.
Solution 2: Make
devenv.exe
large address aware:Open up a Visual Studio Command Prompt (or a Developer Command Prompt, depending on the version of Visual Studio)
Type and execute the following command line:
where
{path}
is the path todevenv.exe
(you can find this by going to the properties of the Visual Studio shortcut).This will allow
devenv.exe
to access 3GB of memory instead of 2GB.问题
就我而言,问题出在包含非常大 (1.5GB) 测试文件作为嵌入式资源的测试项目。发生这种情况时,我的机器中有 16GB RAM,其中有 8GB 可用,因此 RAM 不是问题。
我们可能会达到 CLR 对任何单个对象的 2 GB 限制。如果不深入研究 MSBuild 在幕后所做的事情,我只能推测在编译期间,嵌入式资源被加载到达到此限制的对象图中。
错误消息非常没有帮助。当我看到它时,我的第一个想法是:“我的磁盘空间用完了吗?”
解决方案
这是一个文件验证测试项目。要求之一是能够处理这种大小的文件,因此从表面上看,我的团队认为将其嵌入到测试用例中使用是合理的。
我们通过将文件移动到网络上(与生产中的验证器访问它的方式相同)并将测试标记为集成测试而不是单元测试来修复错误。毕竟,单元测试不应该快速运行吗?
Problem
In my case, the problem was with a test project containing a very large (1.5GB) test file as an embedded resource. I have 16GB RAM in my machine with 8GB free when this occurred, so RAM was not the issue.
It is possible that we are hitting the 2 GB limit that the CLR has on any single object. Without delving into what MSBuild is doing under the hood, I can only speculate that during compile time, the embedded resource is loaded into an object graph that is hitting this limit.
The Error message is very unhelpful. My first thought when I saw it was, "Have I run out of disk space?"
Solution
It is a file validation test project. One of the requirements is to be able to handle files of this size, so on face value my team thought it reasonable to embed it for use in test cases.
We fixed the error by moving the file onto the network (in the same way that it would be accessed by the validator in production) and marking the test as an integration test instead of a unit test. After-all, aren't unit tests supposed to be fast-running?
清理和重建解决方案对我有用
Cleaning And rebuilding the solution worked for me
对于 Visual Studio,您可以尝试执行以下操作:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
。editbin /LARGEADDRESSAWARE devenv.exe
。希望这有帮助)
For Visual Studio, you can try to do the following:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
.editbin /LARGEADDRESSAWARE devenv.exe
.Hope this helps )
就我而言,C 盘中剩余的内存非常少。我从C盘清除了一些项目并重试。它起作用了。
In my case, I had very less memory left in C drive. I cleared few items from C drive and tried again. It worked.
我可能会迟到回答,但为了将来的参考,您可能需要检查 Windows 转储文件设置(并且可能将其设置为无)。
I might be late to answer but for future reference, you might want to check the Windows dump file settings (and probably set it to none).