You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been happily using the CustomTool version for years, but today decided to get with the program and install the newer VS Extension. When I ran "Build Models..." I get a dialog mentioning a failure and the output window says:
UmbracoModelsBuilder: Starting v8.1.1 7/20/2020 4:42:06 PM.
UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: MissingMethodException: Method not found: 'System.String Umbraco.ModelsBuilder.Building.Compiler.CreateValidIdentifier(System.String)'.
UmbracoModelsBuilder: at ZpqrtBnk.ModelsBuilder.Extension.Generator.GetNameSpace(String path)
at ZpqrtBnk.ModelsBuilder.Extension.Generator.TryGenerate(ProjectItem sourceItem)
at ZpqrtBnk.ModelsBuilder.Extension.Generator.Generate(AsyncPackage package, ProjectItem sourceItem)
This is my models folder structure:
The "ContentTypes" folder is not included in any project namespaces - it is just to separate "Umbraco Content Type-based" models from any other custom models needed.
My "_ModelBuilderConfig.cs" file includes an explicit namespace:
using Umbraco.ModelsBuilder;
[assembly: ModelsNamespace("MySite.Models")]
Perhaps this is related to this other issue: #228 ?
The text was updated successfully, but these errors were encountered:
not sure if this is still a problem, but i just ran into this today and my solution was to disabled (or remove) the old visual studio extension for modelsbuilder
@hfloyd I'm sure you are well past this already but I've hit the same issue in an old project and solved it so I will leave this comment here for anyone else that might have the problem including my future self. Coming from the previous version of the tool I had a .cs file I used to generate the classes previously. At some point I had removed the contents of the file. Adding the namespace in the file with no class made the error go away. That said, I removed the .cs file anyway afterwards to use this new method with the .mb file.
@EelmanE Your solution also helped me with another issue I had when running the tool 👍
I have been happily using the CustomTool version for years, but today decided to get with the program and install the newer VS Extension. When I ran "Build Models..." I get a dialog mentioning a failure and the output window says:
This is my models folder structure:
The "ContentTypes" folder is not included in any project namespaces - it is just to separate "Umbraco Content Type-based" models from any other custom models needed.
My "_ModelBuilderConfig.cs" file includes an explicit namespace:
Perhaps this is related to this other issue: #228 ?
The text was updated successfully, but these errors were encountered: