我最近買了一臺新計算機,並將此項目上載到FTP服務器,然後將其下載到我的新計算機,但現在它導致此錯誤:未處理的異常:System.InvalidProgramException:公共語言運行時檢測到一個無效的程序
Unhandled Exception: System.InvalidProgramException: Common Language Runtime det
ected an invalid program.
at Nancy.Conventions.NancyConventions.<Validate>b__1(Tuple'2 result)
at System.Linq.Enumerable.WhereEnumerableIterator'1.MoveNext()
at Nancy.Conventions.NancyConventions.Validate()
at Nancy.Bootstrapper.NancyBootstrapperBase'1.Initialise()
at Nancy.Hosting.Self.NancyHost..ctor(INancyBootstrapper bootstrapper, HostCo
nfiguration configuration, Uri[] baseUris)
at Nancy.Hosting.Self.NancyHost..ctor(Uri baseUri, INancyBootstrapper bootstr
apper, HostConfiguration configuration)
at PokerServer.Program.startServer() in f:\Projects\Visual Studio\PokerServer
\PokerServer\Program.cs:line 93
at PokerServer.Program.Main() in f:\Projects\Visual Studio\PokerServer\PokerS
erver\Program.cs:line 23
它在舊電腦上運行良好。
我更新了.NET(以及在另一個線程中提到的Windows Update下的所有其他更新)。
我已經嘗試過無效和主動的「代碼優化」,沒有任何問題。
該目錄與以前不一樣,不確定是否會導致此問題?
驗證我的代碼peverify,如果我理解正確的是一切看起來不錯:
F:\Projects\Visual Studio\PokerServer\PokerServer\bin\Debug>peverify PokerServer
.exe /md /il
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
All Classes and Methods in PokerServer.exe Verified.
任何幫助,不勝感激!
VS 12.0.30723.00。我從Nuget Manager中刪除並重新安裝了Nancy,現在它可以工作。 – Jefecito 2014-11-08 21:33:01