问题:

我试图以.NET 4.6为目标,并通过将C#语言版本更改为6来利用最新的C#版本。

但是在编译期间我遇到了这个错误:

错误无效选项’6’表示/ langversion; 必须是ISO-1,ISO-2,3,4,5或默认值

如果我将Web.Config设置中的/langversion:6更新为5,它可以工作,

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701">

但是如何在不使用低语言版本的情况下解决这个问题呢?

我正在使用Visual Studio 2015社区版,我还手动安装了.NET Framework 4.6,以防Visual Studio 2015默认安装它。

该项目是Visual Studio 2015创建的标准ASP.NET MVC模板项目。

I am trying to target .NET 4.6 and also take advantage of the latest C# version by changing the C# language version to 6.However during compilation I got this error:Error Invalid option ‘6’ for /langversion;must be ISO-1, ISO-2, 3, 4, 5 or DefaultIf I update the /langversion:6 in Web.Config setting to 5 it works,But how do I resolve this without resorting to lower language version?I am using Visual Studio 2015 Community Edition, and I have also installed .NET Framework 4.6 manually just in case it was not installed by default by Visual Studio 2015.The project is a standard ASP.NET MVC template project created by Visual Studio 2015.

问题:

我正在尝试使用命令yum install contextBroker更新Orion ContextBroker。 不幸的是我收到以下错误:

加载的插件:fastermirror,refresh-packagekit,安全加载

来自缓存主机文件的镜像速度

错误:无法检索存储库的metalink:epel。 请验证其路径,然后重试

怎么可能出错?

I’m trying to update Orion ContextBroker using the command yum install contextBroker.Unfortunatelly I get the following error:Loaded plugins: fastestmirror, refresh-packagekit, security Loadingmirror speeds from cached hostfileError: Cannot retrieve metalink for repository: epel.Please verify its path and try againWhat could be going wrong ?

问题:

这是在Windows Server 2008上运行的,几个月前就可以运行了。 我刚刚再次使用这个服务器与VS一起开发工作。

这是用于提供一些测试站点的实时Web服务器。

这在运行Visual Studio时启动,然后启动我的项目以进行调试。

尝试在IISExpress启动时通过localhost:xxxx启动任何站点(使用配置中的实际端口#来访问不同的站点):

This webpage is not available

ERR_CONNECTION_REFUSED

我已经在这几天了,因为我已经读过其他人有过类似的问题,尝试了我读过的大部分内容,包括将managedruntimeversion从“v4.0”更改为“v4.0.30319”(我有从来没有必要这样做)并禁用日志记录模块( 此处的所有建议)。

我的hosts文件中只有两个条目指向内部服务器IP地址。 没有与localhost相关的IP或引用。

我已经完成了重新安装IIS Express和Visual Studio 2013.我还创建了一个全新的WebApplication站点来尝试解决这个问题(简单而没有其他复杂的绑定)。

当我旋转Fiddler时,我在页面上看到以下内容:

[Fiddler] The socket connection to localhost failed. 
ErrorCode: 10061. 
No connection could be made because the target machine actively refused it 127.0.0.1:23162

提琴手捕获

我已经从IE的LAN连接部分删除了所有代理设置,之前我在VS中获得了一个red-x弹出窗口,表明IISExpress无法启动

这不是SSL与非SSL的问题。

我安装了TFS服务器 – 卸载了,以防有一些奇怪的绑定干扰。

我尝试多次删除IISExpress配置/设置文件夹。

当前的applicationhost.config包含:

<site name="WebApplication1" id="4">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\TFS-WorkRepository\Sandbox\WebApplication1\WebApplication1" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:23162:localhost" />
                </bindings>
            </site>
            <siteDefaults>
                <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
                <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
            </siteDefaults>
            <applicationDefaults applicationPool="Clr4IntegratedAppPool" />

我希望有一个really-stuck的标签。

请建议离开,因为我不想转向新的服务器。

– 更新 –

在URL栏中,当我输入计算机名称或IP地址时:xxxx我得到ERR_CONNECTION_TIMED_OUT而不是ERR_CONNECTION_REFUSED

This is running on Windows Server 2008 and used to work several months ago.I am just now using this server again for some dev work with VS.This is live web server used to serve up a few test sites as well.This came up when running Visual Studio, then launching my projects for debugging.Trying to launch any site through localhost:xxxx when IISExpress has been launched (using actual port #’s in the config to access different sites):I have been at this for a few days already, as I have read others have had similar issues, tried most things I have read including changing the managedruntimeversion from “v4.0” to “v4.0.30319” for .net 4.5 (I have never had to do this before) and disabling the logging module (all suggestions found here ).There are only two entries in my hosts file that point to internal server IP addresses.No localhost related IP’s or references.I have gone as far as re-installing IIS Express, and Visual Studio 2013. I also created a brand new WebApplication site to try to resolve this (simple and no other complicated bindings).When I spin up Fiddler, I see the following on the page:I have removed all proxy settings from IE’s LAN connection section, where before I was getting a red-x popup in VS indicating something like IISExpress could not launch .This is not a matter of SSL vs non SSL.I had TFS Server installed – uninstalled that in case there were some odd bindings that were interfering.I tried deleting the IISExpress config/settings folder several times.Current applicationhost.config contains:I wish there was a tag for really-stuck .Please suggest away, as I don’t want to go as far as spinning up a new server.— UPDATE —In the URL bar, when I enter the computer name or IP address :xxxx I get the ERR_CONNECTION_TIMED_OUT rather than ERR_CONNECTION_REFUSED .

问题:

我正在初始化HttpWebRequest,然后检索它的响应。 有时,我得到500(或至少5 ##)错误,但没有描述。 我对两个端点都有控制权,希望接收端能获得更多信息。 例如,我想将异常消息从服务器传递到客户端。 使用HttpWebRequest和HttpWebResponse是否可能?

码:

try
{
    HttpWebRequest webRequest = HttpWebRequest.Create(URL) as HttpWebRequest;
    webRequest.Method = WebRequestMethods.Http.Get;
    webRequest.Credentials = new NetworkCredential(Username, Password);
    webRequest.ContentType = "application/x-www-form-urlencoded";
    using(HttpWebResponse response = webRequest.GetResponse() as HttpWebResponse)
    {
        if(response.StatusCode == HttpStatusCode.OK)
        {
            // Do stuff with response.GetResponseStream();
        }
    }
}
catch(Exception ex)
{
    ShowError(ex);
    // if the server returns a 500 error than the webRequest.GetResponse() method
    // throws an exception and all I get is "The remote server returned an error: (500)."
}

任何帮助,将不胜感激。

I am initiating an HttpWebRequest and then retrieving it’s response.Occasionally, I get a 500 (or at least 5##) error, but no description.I have control over both endpoints and would like the receiving end to get a little bit more information.For example, I would like to pass the exception message from server to client.Is this possible using HttpWebRequest and HttpWebResponse?Code:Any help with this would be much appreciated.