Trong Visual Studio 2012 tôi đã tạo một dự án ASP.NET MVC 4 nơi khung đích là Khuôn khổ .NET 4.5. Khi tôi triển khai dự án của tôi đến một máy chủ web nó đã cho các lỗi sau:Không thể tải tệp hoặc lắp ráp 'System.Web.Http.WebHost, Phiên bản = 4.0.0.0, Văn hóa = trung lập, PublicKeyToken = 31bf3856ad364e35'
Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file
specified.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where
it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or
assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
Source Error:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
Bạn đã sử dụng triển khai web hay bạn đã triển khai nó như thế nào? – John
@John i xuất bản và sau đó sao chép các tệp đó để lưu trữ – user1688401
Bạn có thể trực tiếp xuất bản lên máy chủ không? Hoặc sử dụng trang web triển khai zip hoặc một cái gì đó? Điều đó sẽ đảm bảo tất cả các tệp được bao gồm. Ngoài ra hãy chắc chắn rằng MVC đã được cài đặt trên máy chủ. – John