【发布时间】:2015-01-08 09:37:50
【问题描述】:
我通过 github 安装了 NancyFX 0.23.2 源代码,并在 Windows 7 x64 上使用 VS2013 Pro 进行构建。我可以很好地构建,但是当我通过 GenericFileRespose 返回 anything 时,我得到:
A first chance exception of type 'System.Net.HttpListenerException' occurred in System.dll
---
System.Net.HttpListenerException (0x80004005): The parameter is incorrect
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
at Nancy.Responses.GenericFileResponse.<>c__DisplayClass1.<GetFileContent>b__0(Stream stream) in h:\home\projects\nancy\0.23.2\Nancy\src\Nancy\Responses\GenericFileResponse.cs:line 82
at Nancy.Hosting.Self.NancyHost.OutputWithDefaultTransferEncoding(Response nancyResponse, HttpListenerResponse response) in h:\home\projects\nancy\0.23.2\Nancy\src\Nancy.Hosting.Self\NancyHost.cs:line 320
at Nancy.Hosting.Self.NancyHost.ConvertNancyResponseToResponse(Response nancyResponse,
...
如果我链接到通过 nuget 检索到的 Nancy 二进制文件,我的输出很好,但我没有 Nancy 的调试信息。
我启动了 Nancy 自我托管演示,它似乎运行良好,但如果我能说出我的项目有什么不同的话,我就冒险了。一切都是为“任何 cpu”而构建的。 Nancy 是使用目标 .net 4.0 客户端配置文件构建的,Nancy.Hosting.Self 目标是完整的 .net 4.0,我的类库和启动 NancyHost 的控制台应用程序也是如此。
任何见解将不胜感激。
【问题讨论】:
标签: c# nancy self-hosting