简体   繁体   English

Visual Studio 2012 for Web,修复了定位框架错误

[英]Visual Studio 2012 for web, fix targeting framework error

I got a very weird error after my computer was a little messed up with deleting various versions of VSs and SQL Servers. 我的计算机因删除各种版本的VS和SQL Server而有些混乱之后,出现了一个非常奇怪的错误。 It seems like i fixed the project setup and had been a "good girl" following Microsoft's advices. 似乎我已经解决了项目设置问题,并且按照微软的建议成为了一个“好女孩”。 However here is the error!when I open my project I get this window. 但是这里是错误!当我打开我的项目时,我得到这个窗口。 From what I found it that VS 2012 for web by default targets 4.5 framework, so sound like my error just should not be happening. 从我发现的结果来看,VS 2012 for web默认针对4.5框架,所以听起来好像我的错误不应该发生。 I already tried following the second option and installing whatever it wants,unfortunately nothing has changed error message 我已经尝试按照第二个选项安装所需的任何东西,但是不幸的是,没有任何更改

在此处输入图片说明在此处输入图片说明

any suggestions that wont need me to re-install the the whole thing? 有什么建议不需要我重新安装整个东西吗?

Try the web.config as this is the area where the error will most likely reside. 尝试使用web.config,因为这是最有可能出现错误的区域。 You can 'force' the web.config to be a specific version and I would add both c# and vb/net so they are always there. 您可以“强制” web.config为特定版本,我将同时添加c#和vb / net,以便它们始终存在。 I have a web.config template I start all my projects with. 我有一个web.config模板,可以用来启动所有项目。 Below is a cut of the part I believe you need. 以下是我认为您需要的部分内容。 Just change the value of the .net 只需更改.net的值

<system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM