0

I Just started using Umbraco CMS v.9 and when I try to see the page I just created it shows an error.
Code

@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.HomePage>
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
    Layout = null;
}
<!DOCTYPE>
<html>
    <head>
        @Model.Name
    </head>
    <body>
        <div>
            @Model.Check
        </div>
        <div>
            
        </div>
    </body>
    <footer>
        
    </footer>
</html>

Error:
The type 'IEnumerable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

I've been searching the solution for a while. I came across a lot of other people who have encountered similar (my assumption) problems. I tried to add to web.config something like:

<compilation debug="true" targetFramework="4.5">
  <assemblies>
    <add assembly="System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"/>
  </assemblies>
</compilation>

but any time I rerun, the file web.config get overwritten with the original code deleting the lines I wrote. (this thing is really upsetting me)



How this thing can be fixed?
Thanks

1
  • Umbraco 9 is still in beta, so if you see something not working as expected you should report it over on GitHub (github.com/umbraco/Umbraco-CMS/issues). Umbraco 9 runs on .NET 5 (.Net Core), BTW, maybe you are trying to run it on .Net Framework 4.x? Commented Jun 22, 2021 at 15:38

1 Answer 1

1

I don't think it is v9 you are using if you have a web.config. V9 does not have a web.config file as it is written in .Net Core. Settings are in appsettings.json.

I think you have v8.

Also I think the issue you are facing can happen if your view / class / code is not referencing System.Collections.Generic

Place the following using statement at the top of the page wherever you are referencing IEnumerable

using System.Collections.Generic;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.