views:

318

answers:

2

I have a database project (.dbp) open in Visual Studio 2008 as part of a solution. I've added a new sql script to the project. When I try to save the database project so that I can check it in, VS shows me a dialog:

Some Unicode characters in this file could not be saved. To save all the information in this file, use 'Save As'; and select a Unicode encoding.

If I try to use "Save As.." I get exactly the same dialog.

I'm not very familiar with .dbp files, but I have opened the file in Notepad2 and re-encoded it. VS will reload the project but when I try check in the changes, VS says I need to save the file, and if I do, I once again get the above mentioned dialog.

Interestingly, I have no file association with the dbp file, but VS somehow mysteriously knows what to do with it in the context of a solution. Yet you can't open the dbp with VS on it's own. That broke my brain a little bit.

So I'm at a loss and going around in circles. If anybody can help, I'd appreciate it.

A: 

Not sure I know why this might have happened but it might be worth getting the previous version of the dbp file from source control and diffing the 2 to see if you can work out what's changed.

Jibberish
Hmm, will try and report back.
PabloC
Can't see that there is any difference. I was able to save the database project without any issues on a colleagues' computer. I don't really want to make that the 'answer' though.
PabloC
A: 

This is what I had to do to get around the problem, as there doesn't seem to be a fix that I can create, or find:

Edit the dbp file in an alternative text editor. Add a text entry for the entity that you want to add to the project. For example, to add a script called "Create users table.sql" to the "Changes" folder:

# Microsoft Developer Studio Project File - Database Project
Begin DataProject = "Database Project"
   MSDTVersion = "80"
   SccProjectName = "SAK"
   SccLocalPath = "SAK"
   SccAuxPath = "SAK"
   SccProvider = "SAK"
 Begin Folder = "Changes"
      Script = "Create users table.sql"
 End
End

Save the .dbp file and reload the project in Visual Studio.

PabloC