2014-01-17 1 views
0

프로젝트를 만들려고했지만 web.config에서 TargetFramework 특성을 인식하지 못한다는 오류를 계속받습니다.ASP.NET TargetFramework 특성이 인식되지 않습니다.

편집 : web.config가 추가되었습니다. 나는 같은 문제로 한 가지 질문을 보았고 ASP.NET의 버전과 동일한 버전이어야한다고 말했다. 그러나 나는 그것을하는 법을 정말로 모른다.

P. 로컬 웹에서 파일을 실행할 수 없으므로 다른 버전의 Visual Studio로 변경할 수 없습니다 (해당 프로그램을 사용함). 그러나 그것은 다른 문제입니다.

지금은 오래되었습니다. 그것이 어려운 문제라고 생각해라. 당신의 Web.config = "4.0"targetFramework의 속성을 가지고 있지만, 응용 프로그램 풀은 ASP.NET 2.0을 실행하도록 설정되어있는 경우

<?xml version="1.0"?> 
<!-- 
Note: As an alternative to hand editing this file you can use the 
web admin tool to configure settings for your application. Use 
the Website->Asp.Net Configuration option in Visual Studio. 
A full list of settings and comments can be found in 
machine.config.comments usually located in 
\Windows\Microsoft.Net\Framework\v2.x\Config 
--> 
<configuration> 
<appSettings/> 
<connectionStrings/> 
<system.web> 
    <!-- 
     Set compilation debug="true" to insert debugging 
     symbols into the compiled page. Because this 
     affects performance, set this value to true only 
     during development. 
    --> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 



      </assemblies> 
    </compilation> 
    <!-- 
     The <authentication> section enables configuration 
     of the security authentication mode used by 
     ASP.NET to identify an incoming user. 
    --> 
    <authentication mode="Windows"/> 
    <!-- 
     The <customErrors> section enables configuration 
     of what to do if/when an unhandled error occurs 
     during the execution of a request. Specifically, 
     it enables developers to configure html error pages 
     to be displayed in place of a error stack trace. 

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> 
     <error statusCode="403" redirect="NoAccess.htm" /> 
     <error statusCode="404" redirect="FileNotFound.htm" /> 
    </customErrors> 
    --> 
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>  </system.web> 
<system.codedom> 
</system.codedom> 
<!-- 
    The system.webServer section is required for running ASP.NET AJAX under Internet 
    Information Services 7.0. It is not necessary for previous version of IIS. 
--> 
<system.webServer> 
</system.webServer> 
</configuration> 
+1

이 줄이있는 구성 파일의 부분을 게시 할 수 있습니까? –

+0

잘못된 asp.net 버전 - 아마도 당신이 실행 asp.net 버전이 아닌 일부 속성을 사용합니다. – Aristos

답변

3

이것은 기본적으로 발생합니다. targetFramework 특성은 ASP.NET 2.0에서 완전히 인식 할 수 없습니다. 즉, 구성 파일에서 2.0으로 변경 했더라도 작동하지 않습니다.

응용 프로그램이 4.0로 코딩되어있는 경우 다음 AppPool을> 속성> ASP.NET> 버전> 마우스 오른쪽 버튼으로 웹 사이트에 클릭 IIS 4.0 >로 설정 될 필요가있다 "읽기해야 4.0.21006"하지 2.0

0

Visual Studio에서 Fortify를 사용하려고 할 때이 오류가 발생했습니다. Visual Studio Fortify 플러그인은 msbuild 대신 aspnet_compiler를 사용하려고합니다. 그 정확한 메시지를 던지고있었습니다.

Fortescribe를 사용하여 명령 줄 도구를 사용하여 msbuild를 사용하여 컴파일 할 때 효과적이었습니다. 아마도 귀하의 Visual Studio는 msbuild를 사용하지 않고 있습니까? 아직 웹 응용 프로그램으로 변환하지 않으려는 경우이를 웹 응용 프로그램으로 변환 해보십시오. 내 생각에 Visual Studio는 기본적으로 MSBuild를 사용합니다. 이것이 당신의 문제인지 확실하지 않지만, 나는 정확히 같은 오류 메시지를 얻었습니다. 행운을 빕니다.

관련 문제