在VS 2015 Community Edition中将.Net Framework从4.5.2更改为4.5时出现编译错误 [英] Compilation Error when change .Net framework from 4.5.2 to 4.5 in VS 2015 Community edition

查看:805
本文介绍了在VS 2015 Community Edition中将.Net Framework从4.5.2更改为4.5时出现编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS 2015 Community Edition中将.Net框架从4.5.2更改为4.5之后。我收到以下错误。有谁知道这是什么问题以及如何解决这个问题。看起来编译版本有所不同,但是我已经将web.config修改为4.5

After changing my .Net framework from 4.5.2 to 4.5 in VS 2015 Community edition. I am getting following error. Did anyone know what is the issue and how to solve this. Look like compile version is different, but I have already modify my web.config to 4.5


/应用程序中的服务器错误。

Server Error in '/' Application.

编译错误说明:在
编译服务该请求所需的资源期间发生错误。请
查看以下特定的错误详细信息,并适当地修改源
代码。

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

编译器错误消息:CS1617:/ langversion的选项 6无效;
必须为ISO-1,ISO-2、3、4、5或默认值

Compiler Error Message: CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default

源错误:

[无相关源代码行]

[No relevant source lines]

源文件:行:0

显示详细的编译器输出:

Show Detailed Compiler Output:

C:\Program Files(x86)\IIS Express>
C:\Windows\Microsoft.NET\Framework\ v4.0.30319\csc.exe / t:库
/ utf8output /R:\"C:\Users\admin\AppData\Local\Temp\ASP.NET
文件\root\479d40ee\add72695\assembly\dl3\31bb6ea7\6a8168a8_dae8d001\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
/ R: C:\WINDOWS\Microsoft .Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll
/ R: C:\WINDOWS ....... ............

C:\Program Files (x86)\IIS Express> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Users\admin\AppData\Local\Temp\Temporary ASP.NET Files\root\479d40ee\add72695\assembly\dl3\31bb6ea7\6a8168a8_dae8d001\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS...................

Microsoft(R)Visual C#编译器版本4.6.0079.0

Microsoft (R) Visual C# Compiler version 4.6.0079.0

对于C#5,版权所有(C)Microsoft Corporation。保留所有权利。

for C# 5 Copyright (C) Microsoft Corporation. All rights reserved.

此编译器作为Windows XP的一部分提供。 Microsoft(R).NET Framework,
,但仅支持C#5以下的语言版本,而不再是
的最新版本。对于支持较新版本的C#
编程语言的编译器,请参见
http ://go.microsoft.com/fwlink/?LinkID = 533240

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240

错误CS1617:/ langversion的选项 6无效;必须为ISO-1,
ISO-2、3、4、5或默认值

error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default


推荐答案

我在回答我的问题只是为了让其他用户知道解决方案。经过谷歌搜索和个人研究。所以我恰好做了两件事。

I am answering my question just to let other user know what's the solution. After some googling and personal research. So I precisely did two thing.


  • 转到每个项目属性-> Build-> Advance并将
    语言版本更改为C#5.0

  • 打开启动项目的web.config(在我的情况下为MVC),然后删除
    包含自定义编译信息的codedom部分

这解决了我的问题。

这篇关于在VS 2015 Community Edition中将.Net Framework从4.5.2更改为4.5时出现编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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