Can one force a custom compiler error in c#?
<p>I'm creating a library in C# that can be used within a transaction. However, some of its methods should not be used in a transaction as they cannot be rolled back. These non-transactional methods will throw an exception at run time when used within a transaction.</p>

<p>The question is, can I somehow also force a compile time error when a non-transactional method is used within a transaction?</p>

<p>Thank you in advance.</p>

<p><strong>Update</strong></p>

<p>I should clarify that the compile time errors are for the benefit of 3rd parties who will use my library. As such any solution that requires another framework or extension would not suffice. The ideal solution would stop the project from compiling in Visual Studio.</p>
