Wixsharp: Files starting with a number cause error - Every identifier must begin with either a letter or an underscore.

Created on 17 Jan 2018  路  7Comments  路  Source: oleg-shilo/wixsharp

I have a file named 0001_CreateTables.sql. It starts with a number because the scripts need to be applied in order.

In the latest version of Wixsharp, I get the following error.

D:\Development\Bitbucket\connexion\Connexion.Setup.WixBA\bin\Debug\Connexion.15.0.5443.wxs(654) : error CNDL0014 : The File/@Id attribute's value, '0001_CreateTables.sql_1645679536', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore.

The wix entry looks like this:

          <Component Id="Component.0001_CreateTables.sql_1645679536" Guid="2edfc367-ad84-4f6a-827e-ee0286d77105">
            <File Id="0001_CreateTables.sql_1645679536" Source="Connexion.Database\Connexion\runAfterCreateDatabase\0001_CreateTables.sql" />
          </Component>

Apparently msi doesn't like the first character in the identifier to be a number.

Done / Released bug

All 7 comments

Hello Oleg,

Thanks for having a look at this bug, and as always for the great library.

I was reviewing your change, and I don't think it covers all the cases. For instance, some could add a file:

(foo).txt

I think there are many other cases with unicode characters, so it might be better to check that the first character is between a-z, or A-Z, since that is what msi seems to want.

Just a thought

@oleg-shilo never mind I see that the other characters are checked else where. Sorry for not looking more thoroughly.

馃憤

I am experiencing the same issue with WixSharp 1.6.1.
Is there a workaround for this issue with WixSharp 1.6.1 while we are waiting for the new release?
Or maybe there's an earlier version which does not have this issue?

I rolled back to v1.5.0 which does not have the issue

Sorry. I wasn't aware this issue was so waited bay many.

  • The work around for any problems with the ID is to specify the ID explicitly in the constructor.
  • Another work around to temporary disable current ID allocation algorithm (until it's fixed) with Compiler.AutoGeneration.LegacyDefaultIdAlgorithm = true;.
  • If any specific issue is marked as fixed ("_Done waiting for release_") then the patched dlls can be downloaded immediately after being committed to git from here: https://github.com/oleg-shilo/wixsharp/tree/master/Source/src/WixSharp.Samples.
    Though NuGet packages are published only with the full releases.
  • I typically do a release every month or so, unless there is an urgent fix to deliver. Trigger for an urgent release can be anything. Typically it is my assessment of the celerity of the problem but it can also be a user request as in this case. Thus if you are waiting then... just let me know. :)

I am aiming the new release to be available today.

@oleg-shilo - you are the best!

The LegacyDefaultIdAlgorithm approach worked for me -- I will use that until the new release comes out.

Thank you for a great library!!
It is a true lifesaver 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UweKeim picture UweKeim  路  5Comments

JamesWHurst picture JamesWHurst  路  5Comments

ju2pom picture ju2pom  路  5Comments

milhousemanastorm picture milhousemanastorm  路  4Comments

empz picture empz  路  3Comments