We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

The type initializer for threw an exception

Hi Team,

I am getting The type initializer for ‘’ threw an exception error when trying to apply watermark on excel file type.

using FileStream stream = File.Open(infilename, FileMode.Open, FileAccess.ReadWrite);
using Watermarker watermarker = new Watermarker(stream, new SpreadsheetLoadOptions()); - error occurring in this line

Could you help to resolve this issue?
image.png (76.1 KB)
inner exception is {“Operation is not valid due to the current state of the object.”}

.Net version: .Net 6.0
Group Docs Watermark version : 21.3.0


1 Like


We are investigating this scenario. Your investigation ticket ID is WATERMARKNET-1381.


.NET 6.0 is currently not supported.
However, we are now working on it. You’ll be notified in case of any update.