locked
error: Unable to cast object of type 'Glimpse.Ado.AlternateType.GlimpseDbConnection' to type 'System.Data.SqlClient.SqlConnection'. RRS feed

  • Question

  • User-1548796982 posted

    hi

    my program work fine on localhost but i get this error on host

    Unable to cast object of type 'Glimpse.Ado.AlternateType.GlimpseDbConnection' to type 'System.Data.SqlClient.SqlConnection'.

    why?

    Saturday, January 26, 2019 7:11 AM

Answers

  • User1120430333 posted

    Yuki Tao

    Hi tadbirgaran,

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Best Regards.

    Yuki Tao

    I did it, but it still makes the same mistake

    Of course,  it's not going to work, becuase there is something wrong with your code that is trying to make a cast that it cannot do. Do you have a idea as to where it's going down by showing the code and/or stack trace on the code location where the exception is being thrown?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2019 3:24 PM

All replies

  • User-474980206 posted
    On localhost you are using a Sqlserver ado provider, but something else on the server.
    Sunday, January 27, 2019 10:10 PM
  • User1520731567 posted

    Hi tadbirgaran,

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Best Regards.

    Yuki Tao

    Monday, January 28, 2019 6:42 AM
  • User-1548796982 posted

    Yuki Tao

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Thanks for reply

    I do not want to reinstall it.
    I did your steps. I just did not reinstall it at last. The following error message is given:

    GlimpseSecurityPolicy.cs' could not be found.

    Tuesday, January 29, 2019 6:52 AM
  • User1120430333 posted

    hi

    my program work fine on localhost but i get this error on host

    Unable to cast object of type 'Glimpse.Ado.AlternateType.GlimpseDbConnection' to type 'System.Data.SqlClient.SqlConnection'.

    why?

    You can't tell one object that it's going to be another object, the cast, becuase each object has its own blue print, the class that defines the object, and the blue prints do not match. It's OO 101 and it doesn't matter if it's Java or .NET the OO principles are the same.

    https://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/

    Tuesday, January 29, 2019 7:20 AM
  • User-1548796982 posted

    Hi tadbirgaran,

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Best Regards.

    Yuki Tao

    I did it, but it still makes the same mistake

    Tuesday, January 29, 2019 1:25 PM
  • User1120430333 posted

    Yuki Tao

    Hi tadbirgaran,

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Best Regards.

    Yuki Tao

    I did it, but it still makes the same mistake

    Of course,  it's not going to work, becuase there is something wrong with your code that is trying to make a cast that it cannot do. Do you have a idea as to where it's going down by showing the code and/or stack trace on the code location where the exception is being thrown?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 29, 2019 3:24 PM
  • User-1548796982 posted

    tadbirgaran

    Yuki Tao

    Hi tadbirgaran,

    Please try to remove any glimpse packages via nuget. Then "Clean" your solution and make sure that there are no Glimpse dlls in your bin/obj folders. Next remove anything Glimpse from your "Packages" folder. Once you have done this, clean your solution and reinstall Glimpse again.

    Best Regards.

    Yuki Tao

    I did it, but it still makes the same mistake

    Of course,  it's not going to work, becuase there is something wrong with your code that is trying to make a cast that it cannot do. Do you have a idea as to where it's going down by showing the code and/or stack trace on the code location where the exception is being thrown?

    I found a part I had a problem on host. I added the stored procedure again ... The problem was resolved
    Thanks a lot!

    Wednesday, January 30, 2019 7:39 AM
  • User-1548796982 posted

    This problem was solved on the hosts, but on another local system it still made this error.
    Is on the web.config Should I change? Glimps was on the Web.config

    Wednesday, January 30, 2019 11:25 AM