locked
Aftert changing copy local to true for all references to true, then publish gets compile error RRS feed

  • Question

  • User1868852945 posted

    After changing my referrences copy local property to true, I publish to my remote server which caused this compile error...

    Error 17 Could not load file or assembly 'System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) C:\SchemaTrack_DEV\SchemaTrack\obj\Release\AspnetCompileMerge\Source\views\web.config 38 0 SchemaTrack

    This error points to this web.config code...

    <system.web>
    <compilation>
    <assemblies>
    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35" />
    </assemblies>
    </compilation>
    </system.web>
    </configuration>

    How can I solve this error?  Thanks

    Sunday, December 23, 2018 2:43 PM

Answers

  • User1520731567 posted

    Hi gunderj,

    This error points to this web.config code...

    <system.web>
    <compilation>
    <assemblies>
    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35" />
    </assemblies>
    </compilation>
    </system.web>
    </configuration>

    I suspect that you may have miswritten PublicKeyToken.Please try to modify this line:

    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35" />
    

    to:

    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    

    You better search globally for ‘x31bf38fgf56afff4e35’ and modify in the project.

    And then Rebulid and Publish the project.

    Best Regards.

    Yuki Tao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 24, 2018 8:31 AM

All replies

  • User475983607 posted

    I would set the web,config file in the Views folder back to do not copy as that's the default.  The deployment process combines the web.config into a single configuration file.

    Can you explain the problem you are trying to solve by making this change?

    Sunday, December 23, 2018 2:56 PM
  • User1868852945 posted

    When first deployed to my domain, I was getting url not found error, the ISP suggested setting copy local = true.  This property is different that the Views folder's web.config which has a property called "copy to output directory". 

    When trying to set Copy local back to null, I can only set to true or false (originally it was null).  When wet to true or false I get the same compiile error.  

    Do you know where I should set copy local back to null?

    Thanks.

    Sunday, December 23, 2018 5:40 PM
  • User475983607 posted
    I imagine you need to delete the file from the server.
    Sunday, December 23, 2018 8:48 PM
  • User1520731567 posted

    Hi gunderj,

    This error points to this web.config code...

    <system.web>
    <compilation>
    <assemblies>
    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35" />
    </assemblies>
    </compilation>
    </system.web>
    </configuration>

    I suspect that you may have miswritten PublicKeyToken.Please try to modify this line:

    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=x31bf38fgf56afff4e35" />
    

    to:

    <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    

    You better search globally for ‘x31bf38fgf56afff4e35’ and modify in the project.

    And then Rebulid and Publish the project.

    Best Regards.

    Yuki Tao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 24, 2018 8:31 AM