"Attempt to read or write Protected Memory" error in command line, but not when run through visual studio

StackOverflow https://stackoverflow.com/questions/18840438

  •  28-06-2022
  •  | 
  •  

I have a C# command line application and if I run it while in Visual Studio it runs fine (debug or release, x86). If I open a command prompt and run the executable that was built while debugging it in I receive an "Attempt to read or write Protected Memory" exception error.

Has anyone else ever run into a problem where an application runs fine in VS, but not via the command line?

Thanks in advance!

有帮助吗?

解决方案

Looks like it's because gdal has some issues with .NET 4.0. It seems to work fine with .NET 3.5 and that's all we need for our project. We might be using an old version of gdal as well. http://trac.osgeo.org/gdal/ticket/4049

It would be nice to know why it runs fine within VS and generates an exception outside though.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top