Anvarjon Ruziev
Anvarjon Ruziev

Reputation: 3

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

Upvotes: 0

Views: 105

Answers (3)

Sevitas
Sevitas

Reputation: 36

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

Upvotes: 2

Simply007
Simply007

Reputation: 464

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:

Upvotes: 0

rocky
rocky

Reputation: 7696

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.

Upvotes: 0

Related Questions