Sql-server – Property class Length Annotation PersistedResolvableAnnotation

deploymentloginssql-server-2008-r2ssdt

I am trying to deploy an ssdt project using sqlpackage.exe utility.
I get the following error (in German):

Fehler bei der Erstellung des Bereitstellungsplans. Die Bereitstellung kann nicht fortgesetzt werden. Die Property-Klasse
Length ist nicht in der Element- oder Annotation-Klasse
PersistedResolvableAnnotation enthalten.

It means sth. like:

Error while creating deployment plan. Deployment cannot proceed. The
property-class Length is not included in the element or annotation
class PersistedResolvableAnnotation.

I could not find much information about "PersistedResolvableAnnotation". But I realized that it is included in the model.xml in the dacpac.

It contains handful of SqlLogins defined similar to this one:

<Element Type="SqlUser" Name="[Angela]">
            <Property Name="IsWithoutLogin" Value="True" />
            <Relationship Name="DefaultSchema">
                <Entry>
                    <References Name="[Angela]" Disambiguator="8" />
                    <Annotation Type="**PersistedResolvableAnnotation**" Name="[Angela]">
                        <Property Name="TargetTypeStorage" Value="SqlSchema" />
                        <Property Name="Length" Value="8" />
                        <Property Name="Offset" Value="62" />
                    </Annotation>
                </Entry>
            </Relationship>
        </Element>

Angela (and the other candidates) do not exist on destination server as Login, although they are registered database users in the target db. I would expect another error – if any – than this useless one.

The database the project is based on a pretty old SQL Server verison. Is it possible that this is some deprecated feature / syntax or property coming from Sql Server version and is simply not supported ?
Does anyone know more details?

Best Answer

I found the issue myself. I will document it in case anyone else is facing the issue in future.

The following user definition:

CREATE USER [Angela] WITHOUT LOGIN
    WITH DEFAULT_SCHEMA = [Angela];

created the following code in the model.xml that avoids publishing, maybe because the schema (Angela) used there is invalid because it simply does not exist:

<Element Type="SqlUser" Name="[Angela]">
            <Property Name="IsWithoutLogin" Value="True" />
            <Relationship Name="DefaultSchema">
                <Entry>
                    <Annotation Type="PersistedResolvableAnnotation" Name="[Angela]">
                        <Property Name="TargetTypeStorage" Value="SqlSchema" />
                        <Property Name="Length" Value="9" />
                        <Property Name="Offset" Value="63" />
                    </Annotation>
                </Entry>
            </Relationship>
        </Element>

After changing the user definition to:

CREATE USER [Angela] WITHOUT LOGIN
    WITH DEFAULT_SCHEMA = [dbo];

the model lookes as followes and could be published:

<Element Type="SqlUser" Name="[Angela]">
        <Property Name="IsWithoutLogin" Value="True" />
    </Element>

I have a feeling that this strange behavior is kind of a follow-up of another misbehavior because I would expect the not existing schema to raise a compiler error.