Can't open oxite.database project

Dec 11, 2008 at 8:48 PM
I am using VS 2008 pro with MS SQL server 2008, just installed MVC beta 1. When I tried to open the solution, it throws error as following.

'C:\Inetpub\wwwroot\Oxite\Oxite.database\Oxite.Database.dbproj' cannot be opened because its projet type (.dbproj) is not supported by this version of the application.

Did I miss anything? Thanks.
Coordinator
Dec 11, 2008 at 8:51 PM
@qahwah ... you don't have the Database version of Visual Studio installed, so you might want to try opening up the oxite.vwdexpress.sln file instead. It is the solution without the database or test projects included.
Coordinator
Dec 11, 2008 at 8:52 PM
You need to have Visual Studio Team System 2008 Database Edition installed for the project to work.  You can either just remove the project from the solution yourself (if you still want to run the tests project) or you can instead just run the Oxite.VWDExpress solution file instead, which doesn't include the database or test projects.
Dec 11, 2008 at 9:08 PM
Thanks guys!
So the database is for testing only? Any document shows how to link oxite to MS SQL server? I can't login using the default user name and pa$$w0rd.
Dec 11, 2008 at 10:31 PM
I have the same problem and error of not having team system 2008 installed. Can anyone describe how to use the DB in an external instance I have SS 2008 installed on the same machine as the project files.
Coordinator
Dec 11, 2008 at 10:37 PM
Regarding the database, you'll need attach the .mdf that we ship in the /App_Data folder of the web project (OxiteSite) to your SQL Server instance and then modify the connection string in the web.config of the OxiteSite project to point to your server and using your credentials.
Dec 11, 2008 at 11:22 PM
Thanks Duncan. The connection worked great. The sql log shows I am logging in succesfully but the app is erroring at line 13 of default.aspx.cs "The incoming request does not match any route.". Might there still be a dB problem and the route is not found for that reason?
Coordinator
Dec 11, 2008 at 11:52 PM
@spinoza I've seen that error randomly as well.  I believe it has to do with the app getting confused after an exception has occurred (might be a bug on our end, not sure yet).  Can you debug Oxite and put a breakpoint where the call is executed and then continue to follow it line by line until you hit an exception or something out of ordinary happens?  Let us know if you find anything.
Dec 12, 2008 at 12:09 AM
Ok here are a few things I don't think are right but I have nothing to compare to. Right off the bat in the page load on HttpContext.Current.RewritePath(Request.ApplicationPath);

the currentNotification and is PostNotification show a value of "'HttpContext.Current.IsPostNotification' threw an exception of type 'System.PlatformNotSupportedException'" same for currentNotification.

Then on line 13 the HttpHandler ..RouteCollection count=0. I'll try and restart VS and see what happens.
Coordinator
Dec 12, 2008 at 7:30 AM
hhhmmm...not ruling out that this is our bug, but that error seems like ASP.NET MVC is freaking out about your platform (and then everything breaks after that).  Weird.  What OS are you running on?
Dec 12, 2008 at 3:14 PM
Yea thats what It looked like to me. Gald you concur. I am running 32k Vista sp1, VS 2008 9.0.30729.1 SP1 3.5 framework SP1. Pretty much standard stuff I would think. Could there be something going on with Cassini. I have iis7 installed on this box but I don't think I am running against it not sure how to tell. Also to thrw out a bit more cruft. I am not 100% sure that I am getting to the data even though the logs show the user and the machine are connecting.

Dec 12, 2008 at 4:15 PM
Is it possible to run this with VS 2008 and SQL Server 2005 or not? And if not, when can we see this happen?
Dec 12, 2008 at 4:31 PM
Antony, check the post above "
Regarding the database, you'll need attach the .mdf that we ship in the /App_Data folder of the web project (OxiteSite) to your SQL Server instance and then modify the connection string in the web.config of the OxiteSite project to point to your server and using your credentials" 

It worked for me to run against an external instance of SS 2008 i have some other problems but the DB coneection seems to be good. Give it a try.
Dec 13, 2008 at 5:19 PM
I have SQL server 2008, Developer edition. I am on Vista-64 bit. I cannot attach the .MDF. I get an error:

ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Unable to open the physical file "C:\Code\oxite\Oxite\OxiteSite\App_Data\Oxite.Database.mdf". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)

Coordinator
Dec 15, 2008 at 3:48 AM
That's interesting Anthony, I'm on Vista 64-bit as well, but SQL 2008 Express and had no problem... I doubt this is a limitation of Developer edition, but I wish that error was more descriptive. Can you just create a new DB and use the .sql file that is checked in with the solution now?
Dec 15, 2008 at 11:03 PM
I have run the Oxite.Database.sql script, thanks. It starts off with some errors, but after that creates tables, etc.

Output is:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ':'.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ':'.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ':'.
Msg 5105, Level 16, State 2, Line 1
A file activation error occurred. The physical file name '$(PrimaryFilePhysicalName)' may be incorrect. Diagnose and correct additional errors, and retry the operation.
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ':'.
Msg 911, Level 16, State 1, Line 2
Database '$(DatabaseName)' does not exist. Make sure that the name is entered correctly.
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ':'.
Creating [dbo].[oxite_User]
.. etc. success messages
Dec 27, 2008 at 3:38 AM
You can just use the sqlcmd.exe for that.

1. Open vs.net 2008 / 2005 command line
2. sqlcmd -S .\SQLEXPRESS -i Oxite.Database.sql

Hope this help.
Jan 4, 2009 at 4:15 AM

Anthony,

You need to put the MDF file in the location in your C drive and then go to Management Studio and right click choose attach.  Then you will see the message no LDF file click on that and then click remove.  When you do that the attach will work as expected. Below are also code you can use to attach, known issues it may not work if the parent database is more than one file.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA

 

EXEC sp_attach_single_file_db @dbname=‘MyDatabase’,
    @physname=‘E:\Database\MyDatabase.mdf’

Jan 4, 2009 at 6:36 PM
Hi Caddre.

Here's what I did in more detail. I did not get any messages about LDFs.

- Delete the oxite database, get the latest version of the source via svn from codeplex to local folder “C:\Code\Oxite”.

- In SQL management studio, right-click “databases”, select “attach”, add C:\Code\Oxite\Oxite\OxiteSite\App_Data\Oxite.Database.mdf, click ok on the "locate database files" dialog, click ok on the "attach databases" dialog.

- Get the message “if you are certain that you have added all the necessary full-text catalogs, click OK. To add more catalogs, click Cancel.”

- Click OK to that.

- It fails. The message is: An error occurred when attaching the database(s). Click the hyperlink in the Message column for details.

- The details in the message column are as posted above.

 
Jan 5, 2009 at 4:01 PM

Hi Anthony,

That is not correct I attached only the MDF BradA posted in his blog before I posted here, you need to put the MDF in the folder below which is the Microsoft SQL Server Data subfolder in programs and SQL Server will create the file path for you after the attachment.  You also know you need to make changes in Web.Config after attachment.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA

Then you go to Management Studio and right click attach navigate to the file you added to the SQL Server folder  then click attach look in the LDF section of the attach GUI and you will see the no log file message click on it to enable it then click remove below and then click OK.  If you want you can practice with the BradA Northwind first.

http://blogs.msdn.com/brada/archive/2008/01/29/asp-net-mvc-example-application-over-northwind-with-the-entity-framework.aspx

If you still get an error then it maybe File Stream related which means you have not enabled it so go to configuration manager and right click on SQL Server Service change the account from Network Service to Local System, then click on File Stream click on all the check boxes.  You then go to Management Studio go right click on Server Properties and go to Advanced and you will see file stream is still not enabled change that and re start your box.  Then follow step one.

BTW this editor is not good copy and paste is not enabled, I posted this with Ctrl-V and I have not been able to login for 30 minutes.

Jan 5, 2009 at 10:57 PM
Edited Jan 5, 2009 at 10:58 PM
Ok, take 2 at trying to understand your stream of consciousness suggestions. Here’s what I did:

-    SVN Update to get Oxite to the latest version
-    Note that there is no  folder called “C:\Program Files\Microsoft SQL Server\MSSQL.1”, databases appear to be in “C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”
-    Go to C:\Code\Oxite\Oxite\OxiteSite\App_Data, copy Oxite.Database.mdf to “C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”
-    In SQL management studio, right-click “databases, select “attach”.
-    Get the “attach databases” dialog, click “add”, select the Oxite.Database.mdf in C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”
-    Click “OK” to the “locate database files” dialog, and to the “attach databases” dialog.
-    It fails again, the Error message is as before.

No dialogs were given about missing ldf files.

SQL server service is already running as local system, and there are no options to do with file streams that I can find in configuration manager. That Brad Abrams blog entry that you reference doesn’t seem to have anything to do with attaching databases. Sure I can edit a connection string, once there is a database to connect to.

Jan 6, 2009 at 1:17 AM
Edited Jan 6, 2009 at 2:22 PM

(SQL server service is already running as local system, and there are no options to do with file streams that I can find in configuration manager.)

In configuration manager right click on SQL Server Service go to properties you will see service then FILESTREAM click on it to enable all features.

But that is not the reason for your problem when you click attach in Management Studio and click add to add the file in the SQL Server folder on the lower screen you see Oxite data and Oxite log at the end under messages in the log section you will see not found click on it and you will see remove enabled at the bottom.

 Click remove to remove it and then click ok and you can attach the database. I used BradA's Northwind.MDF because attach MDF is attach MDF in most cases.  I could not post the image at Codeplex because of the editor.

Attach lower pane.

Original file name   File Type  Current file Path    Messages
 
Oxite.MDF             Data      C:

Oxite_log.ldf         LOG       C:                           Not found

Click on the not found line which I have made bold and you will see remove enabled at the bottom click on remove and then click OK.

 

 

Jan 6, 2009 at 4:29 PM
Edited Jan 6, 2009 at 4:30 PM
It works.

The complete correct procedure for attaching the MDF into SQL Server is as follows:

- Use SVN Update to get Oxite to the latest version to a folder, e.g. "C:\Code\Oxite\"
- Locate where MS SQL keeps the database files, e.g. "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA",
- Go to C:\Code\Oxite\Oxite\OxiteSite\App_Data, copy Oxite.Database.mdf to “C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”
- In SQL management studio, right-click “databases, select “attach”.
- Get the “attach databases” dialog, click “add”, select the Oxite.Database.mdf in C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA”
- Click “OK” to the “locate database files” dialog
- In the "database details" list (lower pane), look for the "log" line with "not found" in the "message" column. Select it and click "remove"
- Click “OK” to the “attach databases” dialog
- Click “OK” to the message “if you are certain that you have added all the necessary full-text catalogs, click OK”.
- The database is now present in the list of databases, named "C:\CODE\CODEPLEX\OXITE\OXITESITE\APP_DATA\OXITE.DATABASE.MDF". Right-click it, rename to "Oxite.database"

Done!
Jan 6, 2009 at 5:10 PM
Anthony,

Almost funny but you did not add any techincal value in you current post because there was a new code drop at 8 PM Monday that includes the LDF in the App_Data folder so you are the person who did not understand simple click Not Found to enable Remove.

Happy Coding.
Jan 8, 2009 at 11:22 AM
Edited Jan 8, 2009 at 11:27 AM
That you for your support, Caddre. I wish you both punctuation and politeness.

Documenting the procedure in a way that is easy to follow is important for future reference of other people who may be consulting this forum for similar issues.
Jan 8, 2009 at 1:11 PM
I did not see it that way because my work was used to replace the App_Data folder in source control going back to early December when this thread started.  Note to self post image from image shack and I did not see documentation you are creating a task I can perform in my sleep.


Happy coding       
Mar 13, 2009 at 4:54 AM
I am also having problems with connecting to the database with the same error(s):

I am going to attempt some of these things, but I have several questions:

1) I am running VS 2008 Developer.  Does that mean I cannot run the project?  I can install VS 2008 Pro, but not Team Foundation

2) I have SQL 2005, SQL 2008 and 2008 Express all installed on my system.  Which does Oxite expect?
   All of these are installed with instance names, so there is no SQL default instance on this machine...

3) I do not see ANY database connection info in the Web.Config.  What's up with that?  If I could see the connection info I suspect some of these questions could be ignored.

Thanks,
Tom

Coordinator
Mar 13, 2009 at 5:00 AM
Edited Mar 13, 2009 at 5:02 AM
@tlatourelle

1) VS2K8 Pro should be able to run the database project.
2) SQL Express 2005 is what is needed to run the database project.
3) The connection string is in the web.config of the OxiteSite project. The name of it is "ApplicationServices" (just like the sample app that comes with ASP.NET MVC). Just curious, why are you trying to use the database project? You don't need it. There is an MDF under OxiteSite/App_Data that will be run by default.
Mar 14, 2009 at 4:13 AM
Erik & all,
Depending how your Sql server is setup(named instance etc..) it won't start by default. In this case we need to attach the Db.
In order to avoid the attach issue mentioned above (error 5120) you must start your SSManagement Studio as administrator(right click on menu and select run as admin).
Jean