Jump to content











Photo
- - - - -

Running Visual Studio 2010 on ramdisk


  • Please log in to reply
23 replies to this topic

#1 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 23 February 2011 - 08:30 AM

Visual studio 2010 complains that it can't open the project.sdf file. It seems that it uses SQL CE.

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 23 February 2011 - 08:55 AM

Visual studio 2010 complains that it can't open the project.sdf file. It seems that it uses SQL CE.


What are you trying to do? Do you try to open the ImDisk sources as a Visual Studio project in some way? Are you running Visual Studio on an ImDisk Virtual Disk and getting an error message at some point? In that case, when do you get the error message and what kind of virtual disk? Or, are you trying to do something else? :fine: :dubbio:

#3 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 23 February 2011 - 05:04 PM

Soory for the lack of details.

I checked out a project from bazaar on R:, a 2G imdisk drive formatted with NTFS, with the copy to memory option. At this point there is no .sdf file. Then I open the solution file prototype.sln. VS puts up a message box saying

An error occurred while creating or opening the C++ browsing database file R:\prototype\prototype.sdf. Intellisense and browsing information will not available for C++ projects.

Ensure that Microsoft SQL Server Compact 3.5 is installed and that no other applications are accessing the file. If this problem persists, delete the file and reopen the solution.

It works on C:.

#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 23 February 2011 - 07:15 PM

I see. A C++ project.

I cant seem to see that error when I try that here. But I still don't seem to get IntelliSense for C++ to work on ImDisk drives, so I see the same problem anyway. I wonder if SQL CE has problems with the ImDisk virtual disk in some way. It does not seem to make any difference if I try this on for example image file based virtual disks. :dubbio:

As soon as I get some time I can try to run this with a kernel debugger and try to find out what SQL CE really tries to do. :thumbsup:

#5 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 23 February 2011 - 07:55 PM

I used SysInternals procmon and got the following

20:44:37,9358122 devenv.exe 4264 CreateFile R:\bzr\ramdisk_saver\prototype\prototype.sdf NAME NOT FOUND Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: None, AllocationSize: n/a
20:44:37,9359295 devenv.exe 4264 CreateFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Desired Access: Generic Read/Write, Disposition: Create, Options: Synchronous IO Non-Alert, Non-Directory File, Random Access, Attributes: N, ShareMode: Read, Write, AllocationSize: 0, OpenResult: Created
20:44:37,9361121 devenv.exe 4264 QueryNameInformationFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Name: \bzr\ramdisk_saver\prototype\prototype.sdf
20:44:37,9361517 devenv.exe 4264 QueryNameInformationFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Name: \bzr\ramdisk_saver\prototype\prototype.sdf
20:44:37,9362001 devenv.exe 4264 QueryOpen R:\bzr\ramdisk_saver\prototype\prototype.vcxproj SUCCESS CreationTime: 23-Feb-11 06:20:15, LastAccessTime: 23-Feb-11 06:20:15, LastWriteTime: 23-Feb-11 06:20:15, ChangeTime: 23-Feb-11 06:20:15, AllocationSize: 4 096, EndOfFile: 3 924, FileAttributes: A
20:44:37,9362573 devenv.exe 4264 CloseFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS
20:44:37,9363262 devenv.exe 4264 QueryOpen R:\bzr\ramdisk_saver\prototype\prototype.vcxproj.filters SUCCESS CreationTime: 23-Feb-11 06:20:15, LastAccessTime: 23-Feb-11 06:20:15, LastWriteTime: 23-Feb-11 06:20:15, ChangeTime: 23-Feb-11 06:20:15, AllocationSize: 224, EndOfFile: 217, FileAttributes: A
20:44:37,9364266 devenv.exe 4264 CreateFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
20:44:37,9364486 devenv.exe 4264 QueryOpen R:\bzr\ramdisk_saver\prototype\prototype.sln SUCCESS CreationTime: 23-Feb-11 06:20:15, LastAccessTime: 23-Feb-11 06:20:15, LastWriteTime: 23-Feb-11 06:20:15, ChangeTime: 23-Feb-11 06:21:05, AllocationSize: 1 024, EndOfFile: 884, FileAttributes: A
20:44:37,9364882 devenv.exe 4264 QueryAttributeTagFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Attributes: A, ReparseTag: 0x0
20:44:37,9365051 devenv.exe 4264 NotifyChangeDirectory R:\bzr\ramdisk_saver\prototype NOTIFY ENUM DIR Filter: FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME
20:44:37,9365278 devenv.exe 4264 SetDispositionInformationFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS Delete: True
20:44:37,9365747 devenv.exe 4264 CloseFile R:\bzr\ramdisk_saver\prototype\prototype.sdf SUCCESS
20:44:37,9367477 devenv.exe 4264 QueryOpen R:\bzr\ramdisk_saver\prototype\prototype.vcxproj SUCCESS CreationTime: 23-Feb-11 06:20:15, LastAccessTime: 23-Feb-11 06:20:15, LastWriteTime: 23-Feb-11 06:20:15, ChangeTime: 23-Feb-11 06:20:15, AllocationSize: 4 096, EndOfFile: 3 924, FileAttributes: A
20:44:37,9368343 devenv.exe 4264 CreateFile R:\bzr\ramdisk_saver\prototype\prototype.sdf NAME NOT FOUND Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
20:44:37,9368651 devenv.exe 4264 QueryOpen R:\bzr\ramdisk_saver\prototype\prototype.vcxproj.filters SUCCESS CreationTime: 23-Feb-11 06:20:15, LastAccessTime: 23-Feb-11 06:20:15, LastWriteTime: 23-Feb-11 06:20:15, ChangeTime: 23-Feb-11 06:20:15, AllocationSize: 224, EndOfFile: 217, FileAttributes: A

It's not easy to read, but it seems to me that VS decides to remove the file for some reason.

#6 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 24 February 2011 - 06:55 AM

It's not easy to read, but it seems to me that VS decides to remove the file for some reason.


Yes, probably this means that SQL CE reports that it cannot use it and Visual Studio therefore decides to delete it. Exactly why SQL CE cannot use it is probably not easy to see with Process Explorer. It could be some other kind of device request not related to a particular file that fails for some reason.

#7 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 24 February 2011 - 08:12 AM

Following http://arcanecode.co...atabase-with-c/
I did a small C# program to create a database. I get the following exception trace

Unhandled Exception: System.Data.SqlServerCe.SqlCeException: The file resolves t
o a path that is too long. The maximum length is 260 characters. [ File name = R
:\Temp\ArcaneCode.sdf ]
at System.Data.SqlServerCe.SqlCeEngine.ProcessResults(IntPtr pError, Int32 hr
)
at System.Data.SqlServerCe.SqlCeEngine.CreateDatabase()
at ce_create_db.Program.Main(String[] args) in C:\home\fstx\f\bzr\borg\xpr11\
ce_create_db\Program.cs:line 30

#8 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 08 March 2011 - 03:57 PM

Following http://arcanecode.co...atabase-with-c/
I did a small C# program to create a database. I get the following exception trace

Unhandled Exception: System.Data.SqlServerCe.SqlCeException: The file resolves t
o a path that is too long. The maximum length is 260 characters. [ File name = R
:\Temp\ArcaneCode.sdf ]
at System.Data.SqlServerCe.SqlCeEngine.ProcessResults(IntPtr pError, Int32 hr
)
at System.Data.SqlServerCe.SqlCeEngine.CreateDatabase()
at ce_create_db.Program.Main(String[] args) in C:\home\fstx\f\bzr\borg\xpr11\
ce_create_db\Program.cs:line 30


I am somewhat stuck here. I cannot seem to get the same error. When I follow the instructions at the website you link to and create an SQLCE database on an ImDisk drive with the same version of SQLCE (v3.1) it always seems to work for me. I have tried both memory and image file backed virtual disks. The database files is always created successfully and it is possible to use it and open it again. Strange. ;) :hi:

#9 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 10 March 2011 - 02:18 PM

OK.

I have 8G in this laptop, the imdisk is 2G. It loads on startup, and it loads a NTFS formatted image,
and I think that I used the smallest possible cluster size when I formatted it. The OS is Windows 7
Enterprise 64-bit, winver.exe says Version 6.1, Build 7600.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]
"DriveLetter0"="R"
"FileName0"="\\??\\C:\\RAM2G.IMG"
"Flags0"=dword:00000200
"LoadDevices"=dword:00000001

I will try again after installing SP1 (I'm doing that now)

#10 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 10 March 2011 - 02:27 PM

Can you try on a smaller ram disk? Such as a few hundred MB or so? I am curious to see if that makes any change. Cluster size could be one issue, other issues might be connected to earlier reported problems regarding memory allocation in drivers connected to a device chain that ends with a very large ram disk.

#11 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 11 March 2011 - 05:11 AM

The problem is still there. 100MB without backing file, NTFS with default (4K)
clusters.

#12 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 16 March 2011 - 04:55 PM

Upgraded to 1.41. Still not working. Is there anything I can do?

#13 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 17 March 2011 - 01:19 PM

Upgraded to 1.41. Still not working. Is there anything I can do?


I am not sure. I have tested SQL CE now on a few different machines with the same code example you linked to, without getting the problem you got. Therefore I cannot use a kernel debugger to see which control code handlers ImDisk is missing because I never get an error.

But I get an error somewhat similar to yours (but not the same error message) when I try Visual C++ project on ImDisk drive. When I get some time for it I will try to install Visual C++ 2010 on a machine where I can attach a kernel debugger and see if I can see something there.

#14 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 25 March 2011 - 09:14 AM

What would be involved for me to run the kernel debugger on the machine with the problem?

#15 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 25 March 2011 - 12:28 PM

What would be involved for me to run the kernel debugger on the machine with the problem?


For kernel debugging you practically need two computers, one development machine with the debugger and one machine you can boot up with kernel debugging enabled and a serial cable between. Personally I prefer the debugged machine to be a virtual machine in which case you can let WinDbg (or other debugger) communicated with the debugged kernel through a named pipe instead of physical serial cable.

There are lots of other details to explain but I think you will find most of what you need in WDK documentation. Search for "kernel debugging" or similar! :cheers:

#16 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 25 March 2011 - 08:32 PM

Do one need the checked build?
Only serial, not USB?

#17 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 25 March 2011 - 10:08 PM

Do one need the checked build?
Only serial, not USB?

In WinDbg, open the Help menu and choose the Search menu item. Type USB into the search area and press <ENTER>. Take a look at the first result, which I hope would be Boot Parameters to Enable Debugging.

#18 Victor Milovanov

Victor Milovanov

    Newbie

  • Members
  • 15 posts
  •  
    United States

Posted 14 September 2012 - 08:27 AM

Hello, guys!

I've just faced the same problem with Visual Studio 2012, and a C++ project on my virtual disk. Virtual disk is made with ImDisk and Devio.

#19 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 14 September 2012 - 08:46 AM

It's not easy to read, but it seems to me that VS decides to remove the file for some reason.


The problem is that Process Monitor looks at what happens at filesystem level. We don't see if anything that SQL CE does with direct disk access fails somewhere. If it does, it is pretty much expected that VS removes the file again, but we do not see why.

I would say that the only way to debug this would be to run everything on a virtual machine under kernel debugger and see which control codes ImDisk driver receives. It is still possible that it cannot be supported at all, for example if SQL CE requires volume mount manager interaction or something like that.
  • Victor Milovanov likes this

#20 Victor Milovanov

Victor Milovanov

    Newbie

  • Members
  • 15 posts
  •  
    United States

Posted 14 September 2012 - 09:31 AM

I've found the workaround for C++ IntelliSense problem: go to Visual Studio options, Text Editor -> C++ -> Advanced, set Always use fallback location to True (I tried to leave it False, but it did not work), and provide a fallback location on ordinary disk.

#21 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 14 September 2012 - 09:35 AM

I've found the workaround for C++ IntelliSense problem: go to Visual Studio options, Text Editor -> C++ -> Advanced, set Always use fallback location to True (I tried to leave it False, but it did not work), and provide a fallback location on ordinary disk.


Great, thanks for sharing this!

#22 fstx

fstx

    Newbie

  • Members
  • 10 posts

Posted 14 September 2012 - 09:49 AM

Today I tried to create a SQL server database in the ramdisk, and I got this error message


An unexpected error occurred while checking the sector size for file 'r:dbqldb_clean.mdf'. Move the file to a local NTFS volume, where the sector size can be retrieved. Check the SQL Server error log for more information.

Perhaps this is also what SQL CE tries to do?

#23 Victor Milovanov

Victor Milovanov

    Newbie

  • Members
  • 15 posts
  •  
    United States

Posted 14 September 2012 - 09:52 AM

Today I tried to create a SQL server database in the ramdisk, and I got this error message


An unexpected error occurred while checking the sector size for file 'r:dbqldb_clean.mdf'. Move the file to a local NTFS volume, where the sector size can be retrieved. Check the SQL Server error log for more information.

Perhaps this is also what SQL CE tries to do?

My virtual disk provides its sector size. At least to ImDisk

#24 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 14 September 2012 - 10:13 AM

Today I tried to create a SQL server database in the ramdisk, and I got this error message


An unexpected error occurred while checking the sector size for file 'r:dbqldb_clean.mdf'. Move the file to a local NTFS volume, where the sector size can be retrieved. Check the SQL Server error log for more information.

Perhaps this is also what SQL CE tries to do?


Yes, I have seen both things and it looks pretty much the same.

My virtual disk provides its sector size. At least to ImDisk


It looks like the problem is more that SQL engine does not know how to find a disk device object to ask for sector size. There are no problems with ImDisk reporting sector sizes really, it could easily be checked with devioctl geometry R: or similar (devioctl.exe is available on my website). I would think that modern SQL engines use volume mount manager to query things like this and because ImDisk does not support mount manager interaction at all, SQL cannot determine sector size. A couple of SQL versions back, it was possible to workaround this by mounting the virtual disk to a subdirectory to fool SQL to query the drive where the mount point path was located. But it seems this workaround (more kind of bug really) is not possible anymore.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users