locked
Please help, I need expert help with ASP.NET assembly RRS feed

  • Question

  • User1266736465 posted

    I created a .net assembly(.dll) for framework 4.0 to work on any IIS and the last changes was 9 months ago that is currently working 100% on other client VPN and dedicated but I have encountered that one of my client vpn hosting service is blocking the connection string embedded in the .DLL the application gets the following error 
    "Fill: SelectCommand.Connection property has not been initialized. System.Data Please try again later, if problem persist please contact the administrator."

    I checked all possible events log and IIS log and could find where or how is being forced to be blank or empty, the only thing I noticed that the VPN has been controlled by a VMware.

    Any Idea how the hosting service is blocking the connection string or forcing the connection string to be blank or empty?

    Please help

    Your help is much appreciated

    Thanks

    Tuesday, March 17, 2020 8:33 PM

Answers

  • User1266736465 posted

    Thank you mgebhard for all your help and I also thank all that post their answers, I understand and I was very clear that ASP.NET community did not have to do any about my problem,

    I thought that by posting my problem I was able to find some one that had the same case or similar or maybe an expert in the IIS or hosting that could give me tips or help me solving the problem, but I understand now that all you need to do is work a bit harder or outside of the box and find a way to solve your own problem.

    It took us some times but we nailed it, and some how the there was a script using the same static name as my connection string that was forcing it be empty, thanks to an expert network engineer with lots of knowledge in hosting the problem is solve, I rename my static connection string and obfuscated my .DLL.

    Again I thank you guys for all your help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 26, 2020 12:40 PM

All replies

  • User475983607 posted

    Any Idea how the hosting service is blocking the connection string or forcing the connection string to be blank or empty?

    Doubtful.  I assume the connection string is configured in the web.config.  Did you check the if the connection string is empty?  Or maybe there is a bug in the code.

    Tuesday, March 17, 2020 8:48 PM
  • User1266736465 posted
    I thought I mentioned that the connection string is embedded in the .dll and same connection string i checked it via the SQL Analyzer and it works fine, I also created a small asp.net page to check the same connection string and it also works fine.
    Also as I mentioned the same asp.net software hosted in that hosting service copy and paste in another different hosting VPN server and it works 100%.

    I hope I am more than clear with detail mentioned above.

    Thanks
    Tuesday, March 17, 2020 9:15 PM
  • User475983607 posted

    msdevm

    I thought I mentioned that the connection string is embedded in the .dll and same connection string i checked it via the SQL Analyzer and it works fine, I also created a small asp.net page to check the same connection string and it also works fine.

    Yes you said embedded but I though you meant resource file or configuration.   I did not think there was a hard coded connection string within the code base as a hard coded connection string not a best practice.

    msdevm

    Also as I mentioned the same asp.net software hosted in that hosting service copy and paste in another different hosting VPN server and it works 100%.

    Have you verified the DLL versions are the same?  Keep in mind the error is an empty connection object which usually indicates a code bug.  The VPN or host cannot change your code and force an empty connection object.

    Tuesday, March 17, 2020 10:49 PM
  • User2110873642 posted

    make sure you referenced System.Data in your class library, additionally, you could put the System.Data.dll file in the same directory as your class library

    Tuesday, March 17, 2020 10:50 PM
  • User1266736465 posted
    Thanks for the reply, I have taken all necessary steps troubleshooting the problem and as I mentioned I copied the exact folder from the hosting service that blocking my dll that contains all asp.net pages and bin folder that contains the assemblies and paste it in another VPN hosting service and it works 100%, it connects to the remote SQL server with no problem.

    Thanks again
    Wednesday, March 18, 2020 12:19 AM
  • User1266736465 posted
    Thank you for the reply, software was working fine until couple of days ago, when hosting service desired to block my assembly or force the connection string to be empty.
    Which I am trying to prove the client that the problem is the hosting service who probably wants to sell the client their own software.

    Thanks
    Wednesday, March 18, 2020 12:24 AM
  • User409696431 posted

    "Thank you for the reply, software was working fine until couple of days ago, when hosting service desired to block my assembly or force the connection string to be empty.
    Which I am trying to prove the client that the problem is the hosting service who probably wants to sell the client their own software."

    Asking us a question does not prove anything to your client.  Clearly if it was working, and you changed nothing, and the host changed something, then the problem is with the host.  There is no need to ask us anything, as long as you can confirm that nothing has changed in the code you provided, and that code is what is on the server.

    Thursday, March 19, 2020 7:59 AM
  • User753101303 posted

    Hi,

    If hardcoded, could it be that you have an earlier exception that is ignored ultimately causing Fill to be called without a connection string ? If looking at the code based on the exception details (including the call stack to know where to look at) doesn't give anything, I instrument the app if not done already to check which assumptiion is wrong or which values are involved.

    Thursday, March 19, 2020 8:15 AM
  • User1266736465 posted

    Thank you PatriceSc for the reply, As I mentioned I've copied the entired folder from hosting service(A in VA) that is blocking .DLL and paste it in a different hosting location(B In TX) and .DLL connects with remote sql server with no problem with no changes made the sames exact asp.net pages and .dll, that proves that .dll is blocked at Hosting Location(A)

    I also mentioned that I created an asp.net test page in the Hosting location(A) using the same exact hard coded connection string embedded in the .DLL and it worked 100% fine.

    I made the necessary steps to troubleshoot the problem and I am convinced that my .DLL has been blocked or embedded connection string has been forced to be empty by somehow blanking it out, I am not sure if it is truly blocked or some sort of an hacked injection that clearing out the connection string, I think I've done my homework troubleshooting this problem as far as I could and that is why I posted on the subject of this that I need expert help,

    Thanks again.

    Thursday, March 19, 2020 12:01 PM
  • User753101303 posted

    It's not uncommon to see someone telling his app works on a machine but not on another. I'm not sure what means "blocking" a DLL (I assume you have other stuff in the same DLL that does work ?) and I doubt someone would bother "editing a DLL" to blnak your hardcoded connection string.

    Your connection string is a const ? You can't just redeploy ?

    If I really can''t get what happens I would add trace or validation statements to make 100% sure about what happens when the code runs (assuming I rreally can"t spot how my code could produce the exact exception I see). Also I assume you have ful details and are 100% about where it happens (ie you don"t try to guess from ex.Message but you have the full ex.ToString() details ?)

    Thursday, March 19, 2020 1:00 PM
  • User475983607 posted

    msdevm

    I made the necessary steps to troubleshoot the problem and I am convinced that my .DLL has been blocked or embedded connection string has been forced to be empty by somehow blanking it out, I am not sure if it is truly blocked or some sort of an hacked injection that clearing out the connection string, I think I've done my homework troubleshooting this problem as far as I could and that is why I posted on the subject of this that I need expert help,

    The most likely cause is a bug in your code that shows up in the VA location. 

    Your problem statement is very common.  An application functions as expected in one environment and not another.  And it is very common for the developer to blame the environment when in fact the problem is a code bug.  This forum is full of posts with this symptom and the vast majority of the time it's a logical or configuration bug.

    Let's say the host is maliciously targeting your application.  What do you want the ASP.NET community to do about it?  Find a different host.

    Keep in mind, you can always share your code if you want a community code review.

    Thursday, March 19, 2020 1:06 PM
  • User1266736465 posted

    Thank you mgebhard for all your help and I also thank all that post their answers, I understand and I was very clear that ASP.NET community did not have to do any about my problem,

    I thought that by posting my problem I was able to find some one that had the same case or similar or maybe an expert in the IIS or hosting that could give me tips or help me solving the problem, but I understand now that all you need to do is work a bit harder or outside of the box and find a way to solve your own problem.

    It took us some times but we nailed it, and some how the there was a script using the same static name as my connection string that was forcing it be empty, thanks to an expert network engineer with lots of knowledge in hosting the problem is solve, I rename my static connection string and obfuscated my .DLL.

    Again I thank you guys for all your help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 26, 2020 12:40 PM
  • User475983607 posted

    As I understand, your connection string variable is static.  The web application that references the DLL has a variable with the same name as the static variable which overwrote the static variable.  Basically a bug in the code due to the environment.  Keep in mind a community code review would have found this bug pretty quickly.  

    Thursday, March 26, 2020 12:51 PM
  • User753101303 posted

    You can still ask for help when needeed but the first step is to see what happens exactly rather than assuming what happens. As you see, it turns out that your connection string was really empty which can be found by debugging the code and perhaps reading it (this is why I asked first if this is a hardcoded const). 

    Thursday, March 26, 2020 1:44 PM