salaros / vs-templates-revit-addin

Visual Studio C# (project) template for easy Revit add-in creation
MIT License
82 stars 22 forks source link

external app not working target invocation exception #8

Open AmeerMansour opened 4 years ago

AmeerMansour commented 4 years ago

I used this template and whenever i run it without modify anything, I get this exception. https://drive.google.com/file/d/1GMYBRyPuIgU1r9iEOgsfdZJXC2c84TQ-/view?usp=sharing

AmeerMansour commented 4 years ago

I fixed it by removing static constructor of app class I removed the following lines

` static App() {

if WINFORMS

        global::System.Windows.Forms.Application.EnableVisualStyles();
        global::System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

endif

    }`