Programing

오류 : allowDefinition = 'MachineToApplication'이 응용 프로그램 수준 이상

lottogame 2020. 5. 13. 07:59
반응형

오류 : allowDefinition = 'MachineToApplication'이 응용 프로그램 수준 이상


ASP.Net에서 온라인 프로젝트를 다운로드했습니다. 응용 프로그램을 실행하는 동안 오류가 발생합니다

응용 프로그램 수준 이상으로 allowDefinition = 'MachineToApplication'으로 등록 된 섹션을 사용하면 오류가 발생합니다. 이 오류는 IIS에서 가상 디렉터리가 응용 프로그램으로 구성되지 않아 발생할 수 있습니다.

이 작업을 수행하기 위해 web.config 또는 다른 곳에서 어떤 변경을해야합니까?


방금이 "기쁨"이 발생했습니다. 릴리스 모드에서 웹 응용 프로그램을 게시 한 직후에 나타납니다.

내가 찾은 문제를 지속적으로 해결하는 유일한 방법은 다음 점검표를 따르는 것입니다.

  1. 솔루션이 릴리스 모드로 구성되어있는 동안 솔루션을 정리하십시오.
  2. 솔루션이 디버그 모드로 구성되어있는 동안 솔루션을 정리하십시오.
  3. 솔루션이 디버그 모드로 구성되어있는 동안 빌드하십시오.

이 게시물을 보러 와서 저에게 일어난 일입니다.
그냥 Clean프로젝트 및 오류가 사라집니다. (VS2010 버그 여야 함)


내 웹 사이트의 두 번째 버전을 만들 때이 문제가 발생했습니다. 처음 건축했을 때는 일어나지 않았습니다.

방금 bin 및 obj 폴더를 삭제하고 클린 솔루션을 실행 한 다음 아무 문제없이 다시 빌드했습니다.


없음 IIS 내 에서 사이트를 웹 응용 프로그램 으로 배치 한 디렉토리를 설정해야 합니다 .


이 오류는 프로젝트를 웹 사이트로 열려고 할 때 발생합니다. 웹 사이트 또는 프로젝트를 만들 었는지 확인하는 가장 쉬운 방법은 솔루션 폴더 (예 : 코드를 저장 한 위치)를 확인하고 루트 디렉토리에 * .sln 파일이 있는지 확인하는 것입니다. ve는 프로젝트를 만들었습니다.

추가하기 위해 Visual Studio 메뉴에서 "파일", "웹 사이트 열기"를 선택하여 잠시 동안 생성 한 프로젝트를 열려고 할 때이 오류가 발생했습니다. "파일", "프로젝트 열기"를 선택해야합니다. 대신에. 내가 깨달았을 때 나는 얼굴이 멈추었다.


Visual Studio 2013에서는 잠시 동안이 문제로 어려움을 겪었으며 "IIS에서 응용 프로그램으로 구성되지 않은 가상 디렉터리" 라는 예외를 따르는 것만으로도 쉽게 해결할 수 있습니다.

내 경우에는 내가했던 WebService내부에 심어 IIS website그래서

  1. IIS 관리자에서 웹 사이트를 열었습니다.
  2. WCF 폴더를 마우스 오른쪽 버튼으로 클릭
  3. 클릭 Convert to Application
  4. 그리고 함께 제출 Ok

WCF가 다시 시작되었습니다.


이 오류는 사용중인 코드가 IIS에서 가상 디렉터리가 설정 될 것으로 예상하고 있음을 나타냅니다.

문서를 찾아 필요한 가상 디렉토리를 추가하십시오. web.config루트 디렉토리가 아닌 디렉토리가 있어야합니다 .


뷰 빌드가 활성화 된 MVC 프로젝트가있는 경우 솔루션 중 하나는 빌드 전에 obj 폴더를 삭제하는 것입니다. 프로젝트 파일에 추가 :

<Target Name="BeforeBuild">
    <!-- Remove obj folder -->
    <RemoveDir Directories="$(BaseIntermediateOutputPath)" />
    <!-- Remove bin folder -->
    <RemoveDir Directories="$(BaseOutputPath)" />
</Target>

다음은 기사입니다. 빌드 또는 배포 전에 bin 및 / 또는 obj 폴더를 제거하는 방법


최근 web.config 변경이 잘못된 web.config 파일에있을 수 있습니다.

<machineKey...>속성이 추가되었다 조회수 /의 Web.config . 정리 및 재 구축 횟수에 관계없이 오류가 남아 있습니다. 수정은 속성을 루트 /web.config 로 이동하는 것이 었습니다 .


이 오류가 발생하면

응용 프로그램 수준 이상으로 allowDefinition = 'MachineToApplication'으로 등록 된 섹션을 사용하면 오류가 발생합니다. 이 오류는 IIS에서 가상 디렉터리가 응용 프로그램으로 구성되지 않아 발생할 수 있습니다.

해결 방법
VS 2012와 동일한 문제가있었습니다.

  1. 현재 프로젝트를 언로드하십시오
  2. .csproj를 편집하십시오
  3. 이것을 찾으십시오 <MvcBuildViews>false</MvcBuildViews>
  4. false 대신 값을 true로 변경하십시오.
  5. 프로젝트를 다시로드하면 더 이상이 오류가 발생하지 않아야합니다

그렇다면 하나의 해결책은 컴파일러가 생성 한 프로젝트에서 obj 폴더의 내용을 삭제하는 것입니다.


필자의 경우 하위 디렉토리에 프로젝트게시 한 후에 만 문제가 발생했습니다 . 지식이 부족하여 web_publish하위 디렉토리를 디렉토리 안에 넣었습니다 web_project.

또한 프로젝트에 포함 된 web_publish것과 동일한 것이 포함되어 있음이 분명합니다 Web.config. 그러나 중첩 하위 디렉토리에서 s를 검색 할 때 피해야한다는 web_project것을 알지 못합니다 . 이런 식으로 s가 복제되고 오류가 나타납니다.web_publishWeb.configWeb.config

해결책은 web_publish다른 곳 을 배치하는 것이 었습니다 .


In my case there was a "Backup" folder which contained another copy of the whole website in there. This meant another web.config and so the build failed with this error. I deleted the "Backup" folder, did a Clean solution on the Debug and Release builds, and the error disappeared.


In my case,

Solution contains 6 projects, 1 main and 5 sub directories. all the sub directories having web.config.

When running any page within sub directories, I was getting same error.

I removed this line from web.config,

<authentication mode="Windows"/>

that worked for me.


Clean your project Remove the /obj folder (probably using publish and deploy? - there is a bug in it)


My problem was I had accidentally published my webservice to a pre-completed location on a fresh install of VS2010.

I had published to a folder called PreCompiledWeb, and the presence of the web.config I suspect messed it up.

I simply nuked the folder, and refreshed the project.

When double-clicking this error - it took me to that erroneous web.config file, which tipped me off.


It may be the version problem like you download the project of .Net framework 2.0 and want to open it into the VS2008 then you will need to upgrade to the latest version and VS will create the Backup of the folder in same root directory.You will get the answer here.


I had this error when building the solution with Web Deployment Project created into my solution. I resolve the error by deleting the folder where Web Deployment Project is built to. This folder is specified in "Project Folder" attribute of WDP properties


Delete bin and obj folders. Then rebuild the solution.


Apparently there were two web.config files in my solution. I am using MVC4 and there was another config file under Views and i was making the change in the wrong file. Fixed there helped me.

But you can always change the default redirect/route in the global.asax file.


Probably you have a sub asp.net project folder within the project folder which is not configured as virtual directory. Setup the project to run in IIS.


I added to my website publish script. At the end, delete the obj folder from your website folder.


I've this problem more frequent if "true" is enabled in the project file.

  1. Set false

As Jonny says:

  1. Clean solution whilst your solution is configured in Release mode.
  2. Clean solution whilst your solution is configured in Debug mode.
  3. Build whilst your solution is configured in Debug mode.

I had a project that I didn't want to be a web application I wanted it to be a folder. The answer was to delete the web.config file altogether. It only belongs in the root of an application.


If you face this problem while publishing your website or application on some server, the simple solution I used is to convert folder which contains files to web application.


I've got the same problem in VS 2013 after publishing my project in debug mode. The problem has been solved by removing obj/ files


I have a website project.

In my case I had moved the solution file to another path and that cause the problem. I restored it to the previous location and the problem went out.


For any one still looking, my solution was to delete both the bin and obj folders and restart visual studio seems to fix it.


Via Visual Studio, I had published a WCF Service via FTP, to an external server. It worked fine locally, and when publishing to an internal server, but not to the external. The solution was to publish without providing a Site Path (in other words, publish directly to the root of the virtual directory).

I'm not sure why it worked, since I had already tried moving the files to the root via an external FTP Client - among many other attempts, including all listed here. Maybe it was something with the publish profile, like it was for FabianVal. But I'm not in the mood of testing anymore at this point, since I'm in a hurry to get up to speed after all the days wasted on this problem.


tip 1: clean & then rebuild.

tip 2: just close VS and open again.

tip 3: the downloaded project may be inside another sub folder... open the folder which has you .net files.

c:/demo1/demo/ (all files)

You should have to open demo from vs... not demo1.


I tried every solution above, but none of them worked for my problem. (I'm sure there are 1000 solutions to this problem) For my scenario, I was attempting to publish my WCF web service that I had in test into production.

However, I failed to realize that in production we are HTTPS only, meaning we redirect everything to HTTPS. As it turns out, I was pointing to the service via HTTP instead of HTTPS, thus causing the error. The solution in this scenario was to simply to change the address protocol to HTTPS rather than HTTP.

I hope that helps some poor soul out there trying to figure out this problem.

참고URL : https://stackoverflow.com/questions/2355947/error-allowdefinition-machinetoapplication-beyond-application-level

반응형