PDA

View Full Version : ارور در asp.net 2005



nazaninam
جمعه 04 فروردین 1385, 19:49 عصر
سلام من یک پروژه asp.net 2005 ساختم برای قسمت admin سایت یک پروژه جدید به نام admin به پرژم اضافه کردم از وقتی این پروژه رو اضافه کردم این اررور رو میده در صورتی که هر دو پروژه رو توی iis ام virtual directory کردم و...
اگه میشه کمک کنید ممنون

Error 70 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:\Inetpub\wwwroot\koler\kadmin\web.config 31

rockpigeon
دوشنبه 07 فروردین 1385, 13:31 عصر
دوست عزیز
این error به این علت هستش

This error is generated because the default set of configuration values in web.config require IIS to treat the web site as an application but this has not been configured.



و راه حل آن به اینصورت

1-Run Internet Services Manager (under Control Panel > Administrative Tools)
2Find the project in the list of projects. (Open up your computer in the list and look under "Default Web Site").
3Bring up its properties (Right click > Properties).
4If the "application name" (under "Application Settings" on the "Directory" tab) is greyed out then click '[Create]' and then '[OK]'.

nazaninam
دوشنبه 07 فروردین 1385, 16:44 عصر
دوست عزیزم اگه نوشته های منو بخونید من اولش عرض کردم این پروژه ها رو virtual directory کردم این نوشته ای که شما نوشتید دقیقا راه virtual directory کردن هست من اولین چیزی که به ذهنم رسید همین بود ولی مشکل پا برجاست نمی دونم چرا!! اصلا از وقتی این کارو کردم مشکل ایجاد شد قبل از Virtual directori کردن این مشکل نبود...

rockpigeon
دوشنبه 07 فروردین 1385, 19:42 عصر
دوست عزیز
این راه درست کردن virtual directory نیست . اگر کمی دقت کنید این راه حل به شما کمک خواهد کرد.

nazaninam
دوشنبه 07 فروردین 1385, 22:58 عصر
شما وارد iis میشید روی پروژه که دارید کلیک سمت راست میکنید بعد در قسمت application setting دکمه creat رو می فشارید فکر می کنید این عمل چه کاری انجام میدهد؟؟؟
این عمل اون پوشه مورد نظر شما رو به دایرکتوری مجازی تبدیل میکند
با این حال از توجه شما ممنون اگه راه حله دیگه ای یافتید دریغ نفرمایید
متشکر

rockpigeon
دوشنبه 07 فروردین 1385, 23:46 عصر
دوست عزیز
امیدوارم این لینک ها به شما کمک کنه
http://geekswithblogs.net/ranganh/archive/2005/04/25/37609.aspx
http://p2p.wrox.com/archive/aspx_beginners/2003-03/26.asp

rockpigeon
دوشنبه 07 فروردین 1385, 23:52 عصر
Sometimes when you set up your application on a server with another application, if your directory is below the folder of another application, then you will get this error. This error is caused by the server seeing two web.Config files in what it believes to be one application. The solution is to make sure you do not have another web.config file anywhere in your application and make sure that your web application is in its own directory and not in a folder below another application.
I HOP THAT IT CAN HELP YOU

nazaninam
سه شنبه 08 فروردین 1385, 02:03 صبح
ممنون دوست خوبم مشکل تقریبا حل شد مشکل اینجا بود:


2. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot
be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the
authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level
unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we
wish to protect the admin pages from unathorized users).

But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-

<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>

However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-

<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

Thus you can protect the sub-directory from unauthorized access.

Cheers.

rockpigeon
سه شنبه 08 فروردین 1385, 18:16 عصر
i am so so glad that u can solve this problem

rockpigeon
سه شنبه 08 فروردین 1385, 18:17 عصر
i am so so glad that u can solve this problem

rockpigeon
سه شنبه 08 فروردین 1385, 18:17 عصر
خوشحالم که مشکل حل شد.

rockpigeon
سه شنبه 08 فروردین 1385, 18:19 عصر
خوشحالم که مشکل حل شد.