Unable to cast object of type 'Wisej.Web.Form' to type 'Wisej.Core.IWisejControl' when re-opening WiseJ Project

0
0

Hi,

Any time I re-open a Wisej Project in VS after closing without quitting VS e. g. switching from one solution to another, the Wisej Designer crashes. I always must restart VS. It does not matter which type of Wisej designer object (Page, Window, Desktop) is involved.

Environment:

  • Visual Studio Professional Version 16.7.5
  • Wisej 2.2.14

I never had Wisej 1.x installed or used.

Cheers,

Jens

  • You must to post comments
0
0

This is a common visual studio problem when the same assembly is loaded multiple time. All component libraries using the designer may hit this issue:

https://www.google.com/search?q=visual+studio+a+cannot+be+cast+to+b&rlz=1C1CHBF_enUS870US870&oq=visual+studio+cannot+cast&aqs=chrome.1.69i57j0j69i64.5249j0j1&sourceid=chrome&ie=UTF-8

  • Close all the designer windows
  • Close VS
  • Delete /bin and /obj and /.vs
  • Remove the NuGet package
  • Reopen VS (the design must start closed)
  • Clean, Rebuild
  • Close VS
  • Reopen VS and try the designer

Do this with a new clean project.

Otherwise you have to search for the VS cache and delete it. It’s probably here

C:\Users\%UserName%\AppData\Local\Microsoft\VisualStudio\15.0_6d397e1a\Designer\ShadowCache

15.0_6d397e1a has to be your VS installation instance. There may be more than one.

 

  • Jens Daniel
    Ok I tried this multiple times with new projects, It did not work. Re-opening newly created projects from template which don’t reference nuget packages crashes the designer. Deleting all below ..\AppData\Local\Microsoft\VisualStudio\16.0_0e6d9631\Designer\ShadowCache also didn’t help. This affects only re-opening or switching a solution. If I start VS, open a project and stay there, it is fine. I have VS 2019 (16.7.5) this might be a new issue?
  • You must to post comments
0
0

I also had these errors.

In my case I removed the “WiseJ.Framework” dll from my project and re-add the dll from the local (!) (c => Program Files) folder.

Then it should work.

I got this effect when installing extensions from NuGet and the extensions load the WiseJ.Framework dll from NuGet.

 

  • Jens Daniel
    I tried referencing either file system or nuget. Unfortunately the problem didn’t go away. Even re-opening the same project provokes the effect.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.