Compatible Text rendering

Add-in Express™ Support Service
That's what is more important than anything else

Compatible Text rendering
 
Ranjitha Nagendra




Posts: 40
Joined: 2015-10-26
Hello Addin express team,

In my addin module constructor,I am using the following line:

Application.SetCompatibleTextRenderingDefault(false);

But with Addin express, building the project throws the following exception:

Cannot register assembly. Exception has been thrown by the target of an invocation. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 4334

It compiles and registers fine if I comment this line. Could you please explain?
Ranjitha
Posted 23 May, 2016 07:51:04 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Ranjitha,

I've tried wrapping this code line in a try/catch block. This shows that the exception only occurs when you register the add-in from the IDE; it doesn't occur when the add-in loads in the host application (I tested this on Excel).

The exception message is: "SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application." I suppose the windows created by the IDE produce the issue; but, in fact, I just don't know what causes the issue.


Andrei Smolin
Add-in Express Team Leader
Posted 24 May, 2016 05:58:13 Top