简体   繁体   中英

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

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

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 .

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM