Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
506 views
in Technique[技术] by (71.8m points)

c# - Could not load file or assembly 'System.Web.WebPages'

I've had this problem before, but then all I needed to do was to clean and rebuild the project. Now that doesn't seem to work anymore. When I start my Asp.Net MVC3 project debugger, the site is opened in my browser. Instead of getting the first page presented in the browser, I get this error:

Parser Error Message: Could not load file or assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 
Line 31:         <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 32:         <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 33:         <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 34:       </assemblies>
Line 35:     </compilation>

I can't seem to figure out how to solve this. Any idea?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The solution for me was to go to my server and install the Web Pages Version 2 on the server.

Go to http://www.microsoft.com/en-us/download/details.aspx?id=34600

And download the package and run it.

It was as simple as that.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...