2013-07-16 16 views
37

私はasp.netの死のページです。これは、nugetを使用してmvc4用のwebgreaseとブートストラップをアップグレードした後です。nugetからwebgrease 1.5.1.25624にアップグレードした後、System.IO.FileLoadExceptionが来ています

Server Error in '/' Application.


Could not load file or assembly 'WebGrease' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'WebGrease' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'WebGrease' could not be loaded.


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045

+1

あなたは誰でも少なくとも旧バージョンにパッケージを復元する運があったのですか? – Luke94

+0

@ Luke94:はい、しました。 Huboの指示に従えば、1.3に戻ります。 – LeftyX

+0

私は、彼らに知らせるためにwebgreaseチームに電子メールを書きました。一方、他の選択肢はありませんが、古いバージョンに戻ります。 – LeftyX

答えて

0

これを試してください:上記のDLLがGACにあるかどうかを確認してください。もしそうなら、あなたのカスタムアプリケーションのbinフォルダに、上記のdllが存在するかどうかをチェックしてください。

+0

がチェックされていますが、これは機能しません。 –

36

フォースは、Web.configファイルを開き、ランタイムの下で依存関係の下に置き換え、次のコマンドを

install-package WebGrease -Version 1.3.0 

を使用して、以前のバージョン1.3.0をインストール

uninstall-package -f WebGrease 

パッケージマネージャコンソールを使用してパッケージをアンインストールしますタグ

<dependentAssembly> 
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> 

+0

私はちょうど同じ解決策を書いていました:-) WebGreaseを再インストールする前に従属アセンブリエントリを削除したのと唯一異なるのは – Luke94

+3

です。 –

+0

展開メカニズムによっては、WebGrease.dllの1.3.0バージョンが1.5.1バージョンを上書きしないことがあります。あなたがこの答えを使って展開したかどうか気を付ける何か、それはまだ壊れていました。 – danmiser

3

私たちはアセンブリの厳密な署名に誤りがあることを認識しており、できるだけ早く更新版をリリースするよう積極的に取り組んでいます。今のところ、nuget.orgのWebGrease 1.5.1パッケージを非公開にしました。

+1

これはしばらくして、このエラーが表示されています。 – Steven

+0

何かが古いバージョンを引っ張っていました。 'uninstall-package -f WebGrease'を実行してから 'install-package WebGrease'をインストールすると、新しいバージョンがインストールされ、web.configが更新され、すべてが機能しました。 – Steven

8

私は、web.configファイルに次のコードを追加する必要がありました:

<runtime> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
      <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> 
      <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 
     </dependentAssembly> 
... 
+0

これは私のweb.configsが環境に依存し、各展開環境用にコンパイルされているため、ソースにチェックインされていないため、私の問題でした。環境変数でテンプレート化されたweb.config.tmplファイルを使用します。 – blockloop

5

私は同じエラーが発生しました。 nugetがWebGrease dllを更新したが、web.configファイル(使用されたdllの特別なバージョン)を更新しなかったために起こった。

は、だから私は、私のweb.configファイルに次の行を変更:

<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 

私はdllファイルのプロパティから取ったバージョン(1.6.5135.21930)の数

<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" /> 

に。

この後、すべて正常に動作します。

+1

+1。そのような言葉の関連性を "ひどい"素晴らしい "ナゲット"の更新に播種し始める.... – EdSF

関連する問題