.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

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 172 (show)
Files included: 34 - 1317KB. (show)
Memory used: 1068KB.
Tokens: post-login.
Cache hits: 13: 0.00236s for 26,582 bytes (show)
Cache misses: 2: (show)
Queries used: 17.

[Show Queries]