【解決方法】Crystal Reports に関する問題

プログラミングQA

[ad_1]

やあ..

現在、Crytal レポートを使用している asp.net Web サイト (4.0 フレームワーク) の 1 つを使用しています。これは、ホスティング後にサーバーではなく、localhost でのみ正常に動作しています。

誰でも私に何が問題なのか教えてもらえますか??

解決策 2

以下のリンクを参照してください
http://www.manjuke.com/2009/07/type-in​​itializer-for-threw-exception.html[^]

そして例外について

最初に確認することは次のとおりです。

1) アーキテクチャ (x86、x64)
2)Crystal ランタイム バージョン

C#
TypeInitializationException occurs when a static constructor has an error. It is thrown from static constructors. It actually wraps the errors from static constructors. It cannot be trapped outside of the static constructor reliably.
The Below Program Shows How this error will come

using System;

class Program
{
    static Program()
    {
	//
	// Static constructor for the program class.
	// ... Also called a type initializer.
	// ... It throws an exception in runtime.
	//
	int number = 100;
	int denominator = int.Parse("0");
	int result = number / denominator;
	Console.WriteLine(result);
    }

    static void Main()
    {
	// Entry point.
    }
}

Output

Unhandled Exception: System.TypeInitializationException: The type initializer for
'Program' threw an exception. --->
System.DivideByZeroException: Attempted to divide by zero.
   at Program..cctor() in....
   --- End of inner exception stack trace ---
   at Program.Main()

解決策 1

System.IO.FileLoadException: ファイルまたはアセンブリ ‘log4net、Version=1.2.10.0、Culture=neutral、PublicKeyToken=692fbea5521e1304’ またはその依存関係の 1 つを読み込めませんでした。 見つかったアセンブリのマニフェスト定義がアセンブリ参照と一致しません

上記のエラーは単に次のことを意味します: Log4Net を使用して、サーバーにないエラーをログに記録しています。

log4Net.dll がサーバーに存在することを確認してください。 アセンブリのバージョンは、プロジェクトで参照されているものと同じである必要があります。 アセンブリ バージョンの不一致でも、ここでエラーが発生します。
それをインストールするか、dll をアプリケーションの bin フォルダーに入れます。

解決策 4

同じ問題がありました。 CR ランタイムの 32 ビット バージョンと 64 ビット バージョンの両方をインストールすると、問題が解決しました。

私のプロジェクトはデスクトップ アプリケーションでした。

解決策 3

ターゲットCPUを「any」から「x86」に変更してdllを再コンパイルする必要があり、それで修正されました。

[ad_2]

コメント

タイトルとURLをコピーしました