Lỗi: The Type or Namespace name 'MVC' does not exits in the 'System.Web'

Thảo luận trong 'Lập trình web Asp.net' bắt đầu bởi seolagi, 18/10/21.

  1. seolagi
    Tham gia ngày:
    16/4/14
    Bài viết:
    1,028
    Đã được thích:
    80
    Điểm thành tích:
    48
    Tự nhiên website mình update từ visual studio 2017 lên 2019 thì bị lỗi rất nhiều, tuy lỗi thế nhưng khi chạy thì vẫn chạy bình thường, nó chỉ báo lỗi vậy thôi chứ khong đúng.

    Bạn nào chuyển code từ visual phiên bản cũ sang phiên bản mới mà bị lỗi này không giúp mình sửa lỗi với, mình xài visual studio 2019 phiên bản có activate bản quyền.

    Dotnet 4.7 y chang cái cũ mà lại bị lỗi này

    loi-the-type-predefined-type-system-object-is-not-defined.jpg

    Lỗi như sau:
    • Predefined type 'System.Object' is not defined or imported
    • Severity Code Description Project File Line Suppression State
      Error CS0234 The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 1_Views_Product_LoadProductHistory.cshtml 1 Active
    • The name 'Model' does not exist in the current context
    • Warning CS0168 The variable 'ex' is declared but never used
    • Error CS0103 The name 'Html' does not exist in the current context
    • Error CS0103 The name 'Context' does not exist in the current context
     
    Cảm ơn đã xem bài:

    Lỗi: The Type or Namespace name 'MVC' does not exits in the 'System.Web'

  2. admin
    Tham gia ngày:
    22/5/13
    Bài viết:
    4,894
    Đã được thích:
    1,198
    Điểm thành tích:
    113
    Giới tính:
    Nam
    Chỉ là lỗi duplicate đụng dữ liệu kiểm tra lỗi phiên bản đang sử dụng giữa bản cũ và mới nó bị chạm nhau thôi. Bạn chỉ cần xóa cái cũ đi và chạy cho add cái mới vô hết là được ah.

    Xử lý như sau:

    Bạn vào thư mục của web xóa cái folder: packages đi nhé.

    Sau đó mở web lên, Xóa hết file trong cái folder: obj đi, như hình thì xóa 2 folder DebugRelease đi.

    Sau đó chạy Rebuild lại web là hết lỗi ngay nhé.

    fix-the-type-predefined-type-system-object-is-not-defined.jpg
     
    seolagi thích bài này.
  3. seolagi
    Tham gia ngày:
    16/4/14
    Bài viết:
    1,028
    Đã được thích:
    80
    Điểm thành tích:
    48
    Cảm ơn ad, em xóa như admin chỉ đã thành công, thanks
     


Chủ để tương tự : Lỗi Type
Diễn đàn Tiêu đề Date
Lập trình web Asp.net Lỗi .woff2 404 - File or directory not found trên iis windows 15/10/20
Lập trình web Asp.net Lỗi Save Web.Config Configuration file: Access to the path .tmp is denied 10/10/18
Lập trình web Asp.net Lỗi font chữ khi sử dụng CKEditor.NET formatted in utf-8 html encoding 9/2/18
Lập trình web Asp.net Lỗi Format datetime khi tạo sitemap trong c#, asp.net 16/6/17
Lập trình web Asp.net Lỗi gửi Gmail: The message could not be sent to the SMTP server asp.net c# 30/5/17