.Net Framework 4.6.1 upgrade

Started by jnk, November 06, 2017, 10:25:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jnk

Hi All,

Long time lurker, first time poster.

I have over the past few years been playing around with a VSTO add-in which has been working well. I recently re-built my machine and reinstalled Visual Studio which and when I opened my solution I am getting a few errors which I think I have worked out is due to a .Net upgrade from version 4 to version 4.6.1. I am not a developer and have seemed to have fumbled my way around well enough but this one has me stumped and was wondering if anyone has experienced this.
A sample of the errors I get are:

Error   BC30590   Event 'Startup' cannot be found.
Error   BC30456   'ActiveWindow' is not a member of 'Application'.

I would love any insights that can save me from having to create a new solution and migrate all the code. Oh I should have mentioned, if I create a new VSTO solution I don't get the same errors...

Cheers
JnK

Paul Herber

Could you post the lines of code that generates these errors?
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

jnk

Certainly. The following code snippets cause the error. This was working perfectly before Visual Studio upgraded the solution to .Net Framework 4.6.1. The following code also works perfectly on a new solution that I create from scratch on .Net framework 4.6.1. It seems that something "breaks" when Visual Studio upgrades the solution.

I have tested this on multiple machines and multiple versions of identical code. The only difference is that as soon as VS upgrades the framework, these errors appear.

Code snippet 1

    Private Sub ThisAddIn_Startup() Handles Me.Startup
        _panelManager = New PanelManager(Me)

        visioApplication = GetObject(, "Visio.Application")

    End Sub

Code snippet 2

    Public Sub TogglePanel()
        _panelManager.TogglePanel(Application.ActiveWindow)
    End Sub