コードの一部をテストするために、いくつかのモックされた EPiServer プロパティを使用しています。そして、これらのプロパティを新しくしている間、例外が発生します。これはクラッシュする行です:
var englishContent = new PropertyXhtmlString {
Name = "EnglishOperationsMessage",
LongString = "Message content in english"};
そして、生成された例外は次のとおりです。
SetUp : System.TypeInitializationException :
The type initializer for 'EPiServer.Util.AutoCompressString' threw an exception.
----> System.IO.FileNotFoundException : Could not find file 'D:\Projects\Antenor-Management-System\Ams.Presenter.Test\bin\Debugweb.config'.
at EPiServer.Core.PropertyLongString.SetDefaultValue()
at EPiServer.SpecializedProperties.PropertyXhtmlString..ctor()
at Ams.Presenter.Test.Login.OperationsMessageTest.GetMockCollection() in OperationsMessageTest.cs: line 58
at Ams.Presenter.Test.Login.OperationsMessageTest.TestSetUp() in OperationsMessageTest.cs: line 19
--FileNotFoundException
at EPiServer.ConfigFileSettings.ᐁ()
at EPiServer.ConfigFileSettings.get_AllAppSettings()
at EPiServer.ApplicationConfiguration..ctor(String configFileName)
at EPiServer.ApplicationConfiguration..ctor(String configFileName, String rootVirtualPath)
at EPiServer.Global.get_EPConfig()
at EPiServer.Util.AutoCompressString..cctor()
これを解決する方法の手がかりは大歓迎です! これは EPiServer 6.42B 用です。