-1
我有一個帶有接口的密封類。無法創建密封類的對象
[Serializable]
public sealed class OrderProcessor : IDisposable
{.....}
這是具有接口實現的獨立類。
[ComVisible(true)]
public interface IDisposable
{
void Dispose();
}
我想在另一個類中創建對象。
OrderProcessor processor = new OrderProcessor();
在創建對象時它給出錯誤。
錯誤:
The type initializer for 'OrderProcessor' threw an exception.
內部異常:
Value cannot be null.\r\nParameter name: assemblyString
注:assemblystring沒有當存在於我的項目。
我該如何做到這一點。
什麼是錯誤? – Habib
在你的問題中包含構造函數和錯誤信息。 –
剛纔我編輯了錯誤描述的代碼。 –