没有足够的存储空间来完成此操作

发布于 2024-11-19 06:12:31 字数 315 浏览 2 评论 0 原文

环境:

  • Visual Studio Ultimate 2010
  • Windows XP
  • 使用 .NET 4.0 的 WPF 桌面应用程序

我们有一个播放视频的桌面应用程序。该视频是项目的一部分,该项目已打包到安装程序中。构建安装程序项目时偶尔会显示此错误消息:

没有足够的存储空间来完成此操作

如果我重新启动 Visual Studio,它就会工作。

有办法避免这种情况吗?有没有更好的方法将视频打包到安装程序中?

Environment:

  • Visual Studio Ultimate 2010
  • Windows XP
  • WPF Desktop Application using .NET 4.0

We have a desktop application which plays a video. This video is part of a project and the project is packaged into the installer. Every once in a while building the installer project shows this error message:

Not enough storage is available to complete this operation

If I restart Visual Studio it works.

Is there a way to avoid this? Is there a better way to package videos in an installer?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

夏至、离别 2024-11-26 06:12:32

就我而言,我执行代码的服务器无法处理我的并行代码。

通常我会运行如下所示的设置,

new ParallelOptions { MaxDegreeOfParallelism = Math.Max(1, Environment.ProcessorCount / 2) }

引入一个变量并允许将内核锁定为 1(产生如下所示的代码),为我解决了这个问题。

new ParallelOptions { MaxDegreeOfParallelism = 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

new ParallelOptions { MaxDegreeOfParallelism = Math.Max(1, Environment.ProcessorCount / 2) }

Introducing a variable and allowing lockdown of cores used to 1 (resulting in code like the following), resolved this issue for me.

new ParallelOptions { MaxDegreeOfParallelism = 1 }
握住我的手 2024-11-26 06:12:32

对我来说关键是:
我们在应用程序中嵌入了一个巨大的数据库模板(测试已填充大量数据)。自从正确删除嵌入式资源并将数据库移动到资源文件夹后,我还没有看到此问题出现。

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.

热血少△年 2024-11-26 06:12:32

我通过删除或禁用(排除)大尺寸的 *.rpt 文件来解决此问题;并且我已经优化了我的报告!

My fix this problem with delete or disable(exclude) the *.rpt files that have large size;and I've optimize the my reports!

猫九 2024-11-26 06:12:32

我回答晚了,但可能对其他人有用
就我而言,只需重新启动 Visual Studio 即可解决问题

I am late to Answer but may be useful for others
In my case just restarting Visual Studio fixes the problem

情感失落者 2024-11-26 06:12:31

当构建过程需要大量 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.

清引 2024-11-26 06:12:31

我在 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 操作系统 说:

进程和应用程序的虚拟地址空间仍然限制为 2 GB,除非在 Boot.ini 文件中使用 /3GB 开关。

/3GB 开关将 3 GB 虚拟地址空间分配给在进程标头中使用 IMAGE_FILE_LARGE_ADDRESS_AWARE 的应用程序。此开关允许应用程序寻址 2 GB 以上的 1 GB 额外虚拟地址空间。

进程和应用程序的虚拟地址空间仍然限制为 2 GB,除非在 Boot.ini 文件 中使用 /3GB 开关。以下示例演示如何在 Boot.ini 文件中添加 /3GB 参数以启用应用程序内存调整:

<前><代码>[引导加载程序]
超时=30
默认=多(0)磁盘(0)rdisk(0)分区(2)\WINNT

[操作系统]
多(0)磁盘(0)rdisk(0)分区(2)\ WINNT =“???” /3GB

注意上例中的“???”是操作系统的编程名称。

在 Windows XP 中,可以通过转到

  • 系统属性 → 高级 → 启动和恢复 → 设置 → 系统启动 → 编辑

/3GB 在 MSDN 上切换说:

在 32 位版本的 Windows 上,/3GB 参数启用 4 GT RAM 调优,该功能可将用户模式虚拟地址空间扩大到 3 GB,并将内核模式组件限制为剩余 1 GB。

Windows Server 2003、Windows XP 和 Windows 2000 支持 /3GB 参数。在 Windows Vista 和更高版本的 Windows 上,请使用 IncreaseUserVA 元素。代码>BCDEdit.

重新启动机器将使设置生效。


解决方案 2:使 devenv.exe 大地址感知:

  1. 打开 Visual Studio 命令提示符(或开发人员命令提示符,具体取决于 Visual Studio 的版本)

  2. 键入并执行以下命令行:

    editbin /LARGEADDRESSAWARE {路径}\devenv.exe`
    

    其中 {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

Not enough storage is available to complete this operation

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 the Boot.ini file, and making devenv.exe large-address aware. Adding the 3GB switch to my Boot.ini file was what worked for me (I think devenv.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 switch

The page Memory Support and Windows Operating Systems on MSDN says:

The virtual address space of processes and applications is still limited to 2 GB unless the /3GB switch is used in the Boot.ini file.

The /3GB switch allocates 3 GB of virtual address space to an application that uses IMAGE_FILE_LARGE_ADDRESS_AWARE in the process header. This switch allows applications to address 1 GB of additional virtual address space above 2 GB.

The virtual address space of processes and applications is still limited to 2 GB, unless the /3GB switch is used in the Boot.ini file. The following example shows how to add the /3GB parameter in the Boot.ini file to enable application memory tuning:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINNT

[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT="????" /3GB

Note "????" in the previous example is be the programmatic name of the operating system.

In Windows XP, the Boot.ini file can be modified by going to

  • System Properties → Advanced → Startup and Recovery → Settings → System Startup → Edit

The page on the /3GB switch on MSDN says:

On 32-bit versions of Windows, the /3GB parameter enables 4 GT RAM Tuning, a feature that enlarges the user-mode virtual address space to 3 GB and restricts the kernel-mode components to the remaining 1 GB.

The /3GB parameter is supported on Windows Server 2003, Windows XP, and Windows 2000. On Windows Vista and later versions of Windows, use the IncreaseUserVA element in BCDEdit.

Restarting the machine will then cause the setting to take effect.


Solution 2: Make devenv.exe large address aware:

  1. Open up a Visual Studio Command Prompt (or a Developer Command Prompt, depending on the version of Visual Studio)

  2. Type and execute the following command line:

    editbin /LARGEADDRESSAWARE {path}\devenv.exe`
    

    where {path} is the path to devenv.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.

寒冷纷飞旳雪 2024-11-26 06:12:31

问题

就我而言,问题出在包含非常大 (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?

对风讲故事 2024-11-26 06:12:31

清理和重建解决方案对我有用

Cleaning And rebuilding the solution worked for me

软糖 2024-11-26 06:12:31

对于 Visual Studio,您可以尝试执行以下操作:

  1. 关闭所有 Visual Studio 实例。
  2. 管理员模式下打开 Visual Studio Developer 工具。
  3. 导航至:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
  4. 输入以下内容:
    editbin /LARGEADDRESSAWARE devenv.exe
  5. 重新启动电脑也是值得的。

希望这有帮助)

For Visual Studio, you can try to do the following:

  1. Close All Visual Studio instances.
  2. Open Visual Studio Developer tool in Administrator mode.
  3. Navigate to:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE.
  4. Type following:
    editbin /LARGEADDRESSAWARE devenv.exe.
  5. It's worth also to restart PC.

Hope this helps )

梦中的蝴蝶 2024-11-26 06:12:31

就我而言,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.

打小就很酷 2024-11-26 06:12:31

我可能会迟到回答,但为了将来的参考,您可能需要检查 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文