Reference System.Web.Webpages.Razor, Version=1.0.0.0. The system cannot find the specified file

Asked

Viewed 4,745 times

-1

We work Aki in the company with SNV with projects.

One day the server stopped working, it was a job to recover the projects. But there is a project that has a reference error with the following message:

Could not load file or Assembly 'System.Web.Webpages.Razor, Version=1.0.0.0, Culture=neutral, Publickeytoken=31bf3856ad364e35' or one of its dependencies. System cannot find specified file.**

The project is in ASP.NET MVC 3. I have already tried to download this package by nuget, make reference by web config. But unsuccessfully. Someone can help.

  • Once I had this too, try to change the version of Razor, like: Version=2.0.0 to see if it works. Sometimes it can work !

  • I tried Erik Thiago, the project was in visual studio 2010... I will try to open the project in visual studio and try to recover this ddl

  • 1

    Exactly. Try this. But try to open the project in a more current version of VS to see if you can change in hand !

  • It worked here, thank you very much Erik Thiago

  • Oopa what a great guy ! Did what I told you or managed to arrange otherwise ? If yes post as answer to people ! If it happens to someone they know where to start ! :)

1 answer

0

In your file Web.config, check the following entry:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      ...
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      ...
    </assemblyBinding>
  </runtime>
</configuration>

Notice that oldVersion is the range of versions, while newVersion is the property Version of your Assembly. Check the entries and test again.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.