I think that your build process provides assembly information separately to providing versioning.
And that causes a duplication as your project also has that info in the AssemblyInfo.cs file. So remove the file and I think it should work
Another solution to keep using the AssemblyInfo.cs file is to turn off automatic assembly info generation like this:
When I exclude the AppData/Models folder from the project and using PureLive the error disappear from the actual build - although I still get some errors with the IntelliSense, which seems to not pick up all the models.
But then I can at least compile and run the project - the only left is the errors with IntelliSense.
I had similar errors when I was playing with the generated Models. Double check your bin folder for any unwanted dll form previously generated models. In my case that was the issue.
after install the vs plugin you have to go to visual studio tools -> options -> Umbraco and add the credentials of the umbraco back office (site url is your local host url)
then you just have to create a .mb file and generate the models, you will find more info about that here. (The site needs to be running when you want to generate models. )
Duplicate AssemblyVersion Attribute
I have this strange error that no amount of Googling on SO etc or here seems to solve for me.
Everything worked fine and then suddenly I get a lot compile errors - as you can see the screenshot below.
It says there is a "Duplicate Assembly Version atttribute" in the AssemblyInfo.cs file, but I have checked and there is not.
This leads to a host of other errors as you can see in the models.generated.cs file.
It's running the newest version of Umbraco and with the standard purelive model generation (I have not changed that).
Hello Martin,
I think that your build process provides assembly information separately to providing versioning. And that causes a duplication as your project also has that info in the AssemblyInfo.cs file. So remove the file and I think it should work Another solution to keep using the AssemblyInfo.cs file is to turn off automatic assembly info generation like this:
Thanks for the suggestions. But none of this works.
I am thinking it might have something to do with whether you are using PureLive or AppData : https://our.umbraco.com/Documentation/Reference/Templating/Modelsbuilder/Builder-Modes
When I exclude the AppData/Models folder from the project and using PureLive the error disappear from the actual build - although I still get some errors with the IntelliSense, which seems to not pick up all the models. But then I can at least compile and run the project - the only left is the errors with IntelliSense.
Hi Martin,
I had similar errors when I was playing with the generated Models. Double check your bin folder for any unwanted dll form previously generated models. In my case that was the issue.
Also I have found it easier to work with the models builder api. For this one to try you will need to install this package https://www.nuget.org/packages/Umbraco.ModelsBuilder.Api/
Add this settings to web config.
Install this visual studio plugin https://marketplace.visualstudio.com/items?itemName=ZpqrtBnk.UmbracoModelsBuilderCustomTool
after install the vs plugin you have to go to visual studio tools -> options -> Umbraco and add the credentials of the umbraco back office (site url is your local host url)
then you just have to create a .mb file and generate the models, you will find more info about that here. (The site needs to be running when you want to generate models. )
https://www.zpqrtbnk.net/posts/models-builder-extension/
And again make sure you have deleted any previously models builder generated dlls or files
Thanks, Thomas
Hi All. I have same error after reading little bit, so I do follow advice from Thomas and now works well at the site best regards thanks
Ok, Guntur.
So you just deleted everything from the bin folder and it worked after that?
is working on a reply...