CMS12 ASP Core New ContentTypes not found

Vote:
 

We have an issue where new pages (ContentTypes) are not found. This is in our DEV domain running IIS Express. My best guess is that maybe the assemblies are not getting scanned even though we have "forceBinFolderScan": true in appsetting.json.

#326245
Edited, Jul 30, 2024 21:55
Vote:
 

Hello Eric,

Are you versioning your DLLs?  This can affect whether Optimizely CMS will update it's models.

e.g.

Lets say you have your DLLs versioned at 1.2.0 when the database is updated with the latest content models.  If you then try to update the content models where your dll is versioned at 1.0.0, then Optimizely will prefer the 1.2.0 version of the content model.

You can read more about model synchronization and dll versions here: Synchronization (optimizely.com)

#326286
Jul 31, 2024 8:26
Eric - Jul 31, 2024 13:28
Thanks for this info. I didn't know about the versioning. I will start versioning the dlls. Does anyone have a good method for auto-incrementing the dlls in the csprog file?

Here is what I've added to my dll that contains the content type classes.





In my case the content type is new so I'm not sure the versioning plays a role in this case but will give it a go.

**************************
Analyze the content types and properties.
Synchronization determines whether each model defined in code (and its properties) is one of the following criteria:

the model is a new content type
the model is an updated version of an existing content type
the model is identical to an existing content type
Synchronization also finds content types and properties in the database that no longer exist in code. Synchronization ignores the content type if the major and minor version numbers of the assembly containing the content type is smaller than the major and minor version numbers that committed changes to the databases during a previous synchronization.
**************************

Mark Stott - Jul 31, 2024 14:54
Hi Eric,

The following is not part of criteria for identifying content types to update. So it may still ignore the content type based on version data within the CMS database. I’d have to version and test this for myself.

“Synchronization ignores the content type if the major and minor version numbers of the assembly containing the content type is smaller than the major and minor version numbers that committed changes to the databases during a previous synchronization.”

You can also go and look at the settings for any content type within the CMS admin interface and see what DLL version that content type is at. That should be a good indicator.

I would also add that if your project does not have a version, it will implicitly become 1.0.0.0
Eric - Jul 31, 2024 15:02
I looked at the tblContentType table and the new content type does not have a row.

I updated the version in the csprog file to 1.0.0.1, , but it had no effect on creating the new content type. All the other content types had 1.0.0.0
Mark Stott - Jul 31, 2024 15:22
But what is the highest version in the ModelType field for other custom content types within the same database and what version is specified in your csproj?
Mark Stott - Jul 31, 2024 15:23
Also does your new content type have the [ContentType] attribute and have you specified a unique GUID for it?
Eric - Jul 31, 2024 15:35
Here is one example. For my Mosaic.Shared.EPi dll, they all currently have 1.0.0.0 and all the content type I've created have a unique GUID.

Mosaic.Shared.EPi.Models.Media.VideoFile, Mosaic.Shared.EPi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Vote:
 

I have a related question. Would these settings stop the newly created content type models or changes to the content type from happening? The other new thing I noticed in CMS12 is that I now have a button on the Content Type page that allows me the create new content types and adds a GUID.

services.Configure<ContentModelOptions>(o =>
{
    o.EnableModelSyncCommit = false;    //https://docs.developers.optimizely.com/content-management-system/docs/synchronization
    o.EnableSemanticVersioning = false; //https://docs.developers.optimizely.com/content-management-system/v1.7.0-content-definitions-api/docs/semantic-versioning
});
#326615
Edited, Aug 06, 2024 14:34
Vote:
 

Yes, content types are not synchronized from code if this flag is false including creating new content type, updating content type, updating properties, adding properties, deleting content type or properties

 o.EnableModelSyncCommit = false;
#326658
Aug 07, 2024 5:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.