I am encountering an error while attempting to create a database using the command line.

2024/10/25 5:23 AM

I am encountering an error while attempting to create a database using the command line.

To Reproduce Steps to reproduce the behavior:

  1. Clone the repository.
  2. Navigate to the dancinggoat folder.
  3. Run the command dotnet restore.
  4. Execute the command to install the database. (i.e, dotnet kentico-xperience-dbmanager -- -s "<sql_server_name>" -d "<database_name>" -a "<admin_password>" --hash-string-salt "<hash_string_salt>" --license-file "<license_file_path>")
  5. See error.

Expected behavior I expected the database to be installed successfully without any errors.

Additional context The error message I received is: "Error installing the database. Original message: Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory."

After encountering the error, the database is created but with database version '28.4.3'. While running the project, I am getting the exception: System.NotSupportedException: 'The database version '28.4.3' does not match the project version '29.3.3', please check your connection string.'


Environment

Answers

2024/10/27 5:06 AM

This appears to be an issue with your database server or connection.

Are you sure the database is actually created and there wasn't an existing older database already there?

It could also be an issue with the dotnet tool you are using to create the database.

The database is populated based on the version of the .NET tool in your Dancing Goat project. There is a tool configuration file under /DancingGoat/.config/dotnet-tools.json which has a version number for the database tool used for the project. This version number should match the version number of the Xperience NuGet packages used by the Dancing Goat project.

The tool can be installed locally or globally.

If you don't actually have the Xperience database dotnet tool installed/restored locally you might actually be using a globally installed version which could be a different version than your ASPNET Core Dancing Goat project.

To answer this question, you have to login first.