Dưới thư mục gốc Tôi có cơ cấu như sauweb.config allowDefinition = MachineToApplication lỗi
..
..
..
web.config
Report Folder
- Login.aspx
- Web.config
|
|-> ViewReport
|
|-> Report.aspx
Trong file web.config của tôi trong thư mục Report tôi có như sau:
<?xml version="1.0"?>
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="ViewReport/Report.aspx">
<credentials passwordFormat="Clear">
<user name="Johl" password="pass888"/>
</credentials>
</forms>
</authentication>
</system.web>
<location path="ViewReport/Report.aspx">
<system.web>
<authorization>
<allow users="Johl"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
</configuration>
Khi tôi bắt đầu gỡ lỗi Tôi nhận được thông báo sau:
Đó là lỗi khi sử dụng phần được đăng ký là allowDefinition = 'MachineToApplication' ngoài cấp ứng dụng. Lỗi này có thể được gây ra bởi một thư mục ảo không được cấu hình như một ứng dụng trong IIS.
Chú ý rằng trong web.config gốc của tôi, tôi có một cái gì đó như sau:
Trong thư mục gốc của tôi, tôi đã có những điều sau đây:
<system.web>
<authentication mode="Forms">
<forms loginUrl="Str/StrUserLogin.aspx" timeout="2880" slidingExpiration="true" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
</system.web>
Bạn đã tạo thư mục ảo tại gốc trang web chưa? – IrishChieftain
Tôi có làm điều này ngay cả khi tôi đang làm việc trên máy chủ cục bộ không? –
Có, đây có thể là nguyên nhân của lỗi này. – IrishChieftain