Bruce_P
Member
- Joined
- Jul 3, 2009
- Messages
- 6
- Programming Experience
- 10+
Hi all,
I have a couple VB.NET apps that are basically training tools that display a series of predefined bitmaps. I originally wrote them on a Windows XP system where they work fine. I recently learned that it crashes when running on Windows 7 64-bit so I've been trying to troubleshoot that. I installed Visual Studio 2008 on a Win7/64 machine and built the apps there. Here's where it gets strange... One app runs absolutely fine when I run it either inside the debugger or standalone. The second app only runs properly if I run it in the debugger. If I run it standalone then it throws the following exception:
System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\NavRules\bitmaps\ship_p.bmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at NavView.crc.calculateFileCRC(String strFile)
at NavView.mainForm.LoadAndVerifyData()
at NavView.mainForm.mainForm_Load(Object sender, EventArgs e)
Why on earth would I get an access denied exception when trying to read a bitmap only when running outside of Visual Studio, and why with only one of two programs that do virtually the same exact thing? And why does it only happen on Windows 7 yet the same app works fine on Windows XP?
Any help would be greatly appreciated.
Thanks,
-Bruce
I have a couple VB.NET apps that are basically training tools that display a series of predefined bitmaps. I originally wrote them on a Windows XP system where they work fine. I recently learned that it crashes when running on Windows 7 64-bit so I've been trying to troubleshoot that. I installed Visual Studio 2008 on a Win7/64 machine and built the apps there. Here's where it gets strange... One app runs absolutely fine when I run it either inside the debugger or standalone. The second app only runs properly if I run it in the debugger. If I run it standalone then it throws the following exception:
System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\NavRules\bitmaps\ship_p.bmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at NavView.crc.calculateFileCRC(String strFile)
at NavView.mainForm.LoadAndVerifyData()
at NavView.mainForm.mainForm_Load(Object sender, EventArgs e)
Why on earth would I get an access denied exception when trying to read a bitmap only when running outside of Visual Studio, and why with only one of two programs that do virtually the same exact thing? And why does it only happen on Windows 7 yet the same app works fine on Windows XP?
Any help would be greatly appreciated.
Thanks,
-Bruce