Error: Not enough storage is available to process this command


Today afternoon I was on a mission to complete a long pending personal project and as part of it I was developing a windows service which extended the support of starting and stopping the service from a console window. After the completion it was time for me to start testing that out and then this weird thing happened. Whenever the system encountered a Console.ReadLine(), it gave me a strange error: “Not enough storage is available to process this command.”  But executing a Console.WriteLine() was not an issue. After playing around with it for a while I figured out the project I had selected was Windows Service and hence it’s output type was Windows Application. Changing the project type to a Console application did the trick. Hopefully this helps someone.

Cheers!

Advertisements

10 thoughts on “Error: Not enough storage is available to process this command

  1. There is more to this though… I too have an application compiled as “Windows Application”. When started through VS Debug Console.In will equal StreamReader.Null. I can check for that and avoid using it. The benefit is that when my system integration tests starts the application, there really _is_ a console in, which I can use for some test control commands. This setup has worked for years. Now suddenly it fails on one developer’s machine – despite this being a “Windows Application”, the Console.In (when run through VS) will be a SyncTextReader instance, but it will fail to read from it, with the “not enough…” error message.

    1. Still don’t now what triggered this problem. It went away after a Visual Studio restart (i.e now Console.In is back to being StreamReader.Null).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s