'Kentico.Kontent.Management The type or namespace name 'AssetIdentifier' could not be found

I have generated a model with Kentico.Kontent.ModelGenerator 6.0.1:

public partial class Car
{
        [JsonProperty("about_image")]
        public IEnumerable<AssetIdentifier> AboutImage { get; set; }
        [JsonProperty("about_text")]
        public string AboutText { get; set; }
        [JsonProperty("additional_header_image")]
}

while compiling getting ERROR :

Error CS0246 The type or namespace name 'AssetIdentifier' could not be found (are you missing a using directive or an assembly reference?)

PS: I'm using the latest Kentico.Kontent.Management 3.0.1



Solution 1:[1]

There has been a major release of Genereators SDK. You can try regenerating your models with the latest version.

Solution 2:[2]

It seems that the AssetIdentifier has been removed and the code generator has not been updated yet.

As a workaround, it might be possible to manually replace the occurrences with Kentico.Kontent.Management.Models.Shared.Reference.

I recommend filing an issue against the kontent-generators-net repo.

Solution 3:[3]

The generator adapted for the new major version of the .NET SDK (3.0.0) is currently in beta - Can you try to regenerate models using 7.0.0-beta4 version?

https://www.nuget.org/packages/Kentico.Kontent.ModelGenerator/7.0.0-beta4

There are still two PRs in the queue before releasing the final version:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sevitas
Solution 2 rocky
Solution 3 Simply007