"unable to switch the encoding" when deploying XML Schemas using Database Professional
I've just blogeed about how to use
XML Schema Collections in Visual Studio Database Professional Project
I mentioned there is one gotcha about. The gotcha is if you have UTF-8
encoded schemas then they fail to be deployed. This is because they get
deployed using
CREATE XML SCHEMA COLLECTION
[dbo].[LogiPointRec]
AS N'<?xml version="1.0"
encoding="UTF-8"?>
Note the N' this results in the following error
XML parsing: line 1, character 38, unable to switch the encoding
To get round this I haven't found a way for Database Professional to not use
the unicode prefix, so you have to change to UTF-16 encoding of you schema. I've
reported this here https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=524977 so
please vote if you have the same problem.