如何更改项目的.NET版本? [英] how can I change the version of .NET for my project?

查看:164
本文介绍了如何更改项目的.NET版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的LINQ表达式不起作用。最有可能是.NET版本。



当我运行程序时,网页显示此错误而不是错误:



My LINQ expression does not works. Most probably it was for the version of .NET.

Instead of error when I run the program the web page shows this error :

Source Error:


Line 161:        List<string> globalTablesList = GetTableNames(dt);
Line 162:
Line 163:        List<string> commonTableList = (from item in distinctItem
Line 164:                                        where globalTablesList.Contains(item)
Line 165:                                        select item).ToList();


Source File: d:\BIPORTAL-Dev\App_Code\Service.cs    Line: 163


Show Detailed Compiler Output:









C:\Program Files(x86)\ Microsoft Visual Studio 9.0 \Common7 \IDE> C:\ Windows \ Microsoft.NET.NET \ Framework \v2.0.50727 \csc.exe/ t:library / utf8output / R:C:\ Windows \assembly \ GAC_MSIL \ System \\ \\ _2.0.0.0__b77a5c561934e089\System.dll/ R:\"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll/ R:C :\ Windows \assembly \ GAC_MSIL \ System.Web.Mobile \2.0.0.0__b03f5f7f11d50a3a \ System.Web.Mobile.dll/ R:C:\ Windows \assembly \ GAC_MSIL \ System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll/ R:\"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll / R:\"C:\Windows\assembly\GAC_MSIL \ System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll/ R:C:\ Windows \assembly \ GAC_MSIL \System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll/ R:C:\ Windows \\ assembly \ GAC_MSIL \ System.ServiceModel \\ 03.0.0__b77a5c561934e089 \ System.ServiceModel.dll/ R:\"C:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0 __b77a5c561934e089\System.Data.DataSetExtensions.dll/ R:\"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll/ R:C:\ Windows \ Microsoft.NET\Framework\v2.0.50727\mscorlib.dll/ R:\"C:\Windows\assembly\GAC_MSIL \ System.Xml.Linq \\ \\ 3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll/ R:\"C:\Windows\assembly\GAC_MSIL \ System.Web.Services \\\ 2.0.0.0__b03f5f7f11d50a3a \ System.Web.Services .dll/R:\"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll/ R:C:\ Windows \assembly \\ \\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f 11d50a3a \ System.EnterpriseServices.dll/ R:\"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll/ R: C:\ Windows \assembly\GAC_MSIL \ System.Xml \\\ 2.0.0.0__b77a5c561934e089 \ System.Xml.dll/ R:C:\ Windows \assembly \ GAC_MSIL \ System。 Web.Extensions\\\\\\\\ .dll/out:\"C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev \\\\\\\\\\\\\\\\\ prcd4lbb.dll/ D:DEBUG / debug + / optimize- / w:4 / nowarn:1659; 1699; 1701C:\ Users\suman.SSD-TECH \ AppData \ Local \Temp\Temporary ASP.NET Files \biportal-dev \ 947cac42 \ 73de6232 \ App_Code.prcd4lbb.0.csC:\ Users \ suman.SSD-TECH \\ AppData \ Local \Temp \Temporary ASP.NET Files \biportal-dev \ 947cac42 \ 73de6232 \ App_Code.prcd4lbb.1.csC:\ Users\suman.SSD-TECH \\ \\ AppData \ Local \ Temp \Temporary ASP.NET Files \biportal-dev \ 947cac42 \73de6232 \ App_Code.prcd4lbb.2.csC:\ Users\suman.SSD-TECH \\ \\ AppData \本地\Temp \Temporary ASP.NET Files \biportal-dev \ 947cac42 \ 73de6232 \ App_Code.prcd4lbb.3.csC:\ Users\suman.SSD-TECH \\ \\ AppData \本地\Temp \Temporary ASP.NET Files \biportal-dev \ 947cac42 \ 73de6232 \ App_Code.prcd4lbb.4.csC:\ Users \ suman.SSD-TECH \\ \\ AppData \本地\Temp \Temporary ASP.NET Files \biportal-dev \ 947cac42 \ 73de6232 \ App_Code.prcd4lbb.5.cs







这是我的网络配置文件:







C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE> "C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /out:"C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.0.cs" "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.1.cs" "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.2.cs" "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.3.cs" "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.4.cs" "C:\Users\suman.SSD-TECH\AppData\Local\Temp\Temporary ASP.NET Files\biportal-dev\947cac42\73de6232\App_Code.prcd4lbb.5.cs"



This is my web config file:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <appSettings/>
  <connectionStrings>
    <!--<add name="cnStringMain" connectionString="Data Source=192.168.1.10;Initial Catalog=BIModel;User ID=sa;Password=Nopass123" />-->
    <add name="cnStringMain" connectionString="Data Source=192.168.241.2;Initial Catalog=BIModel;User ID=sa;Password=Nopass123" />
    <!--<add name="cnStringMain" connectionString="Data Source=JAMILAH\SQLEXPRESS;Initial Catalog=BIModel;Integrated Security=True;User ID=;Password=" providerName="System.Data.SqlClient"/>-->
  </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.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
        -->
    <compilation debug="true" strict="false" explicit="true">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <pages>
      <namespaces>
        <clear/>
        <add namespace="System"/>
        <add namespace="System.Collections"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="System.Collections.Specialized"/>
        <add namespace="System.Configuration"/>
        <add namespace="System.Text"/>
        <add namespace="System.Text.RegularExpressions"/>
        <add namespace="System.Linq"/>
        <add namespace="System.Xml.Linq"/>
        <add namespace="System.Web"/>
        <add namespace="System.Web.Caching"/>
        <add namespace="System.Web.SessionState"/>
        <add namespace="System.Web.Security"/>
        <add namespace="System.Web.Profile"/>
        <add namespace="System.Web.UI"/>
        <add namespace="System.Web.UI.WebControls"/>
        <add namespace="System.Web.UI.WebControls.WebParts"/>
        <add namespace="System.Web.UI.HtmlControls"/>
      </namespaces>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </controls>
    </pages>
    <!--
            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="HTMLPage1.htm">
      <error statusCode="403" redirect="NoAccess.htm" />
      <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>

    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>
  </system.web>

  <system.codedom>
    <compilers>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="OptionInfer" value="true"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>
  </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>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ScriptModule"/>
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*"/>
        <add name="Access-Control-Allow-Headers" value="Content-Type"/>
      </customHeaders>
    </httpProtocol>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>





从这里我们可以看到没有任何部分选择低于3.5版本。但是错误显示它在版本2.0上运行我将如何解决问题?



From here we can see there is no portion select less than version 3.5. But error show it runs on version 2.0 how i will solve the problem?

推荐答案

右键单击您的项目 - >属性



从那里你可以改变项目的目标框架。
Right click on your project -> Properties

From there you will be able to change the target framework of your project.


右键单击你的项目名称可在解决方案资源管理器中找到,现在点击属性。



点击属性后,一个新窗口将打开,在应用程序中你会看到一个选项作为目标框架,它是一个下拉列表,从这里你可以选择框架。
Right Click on your project name which is available in the Solution Explorer, Now click on properties.

On clicking the Properties a new Window will get open, here in the "Application" you will see an option as "Target Framework", it's a dropdown, from here you can choose the Framework.


嘿兄弟,



你是点击解决方案'WebApplication1'(1项目)。你需要点击WebApplication1



这将出现在解决方案'WebApplication1'(1项目)下面。
Hey Bro,

You are clicking on "Solution 'WebApplication1'(1 Project)". You need to click on "WebApplication1"

This would be present just below the "Solution 'WebApplication1'(1 Project)".


这篇关于如何更改项目的.NET版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆