0

The SqlDenpendency.OnChange event is not firing when the tool is published and deployed on IIS Server.

It is working fine on my local machine.

I have referred to this answer https://stackoverflow.com/a/38917421/6763912

  • In IIS can you try enabling Anonymous Authentication and see whether it works. Looks like permission issue to me. – vinothvs May 30 '20 at 12:51
  • @vinothvs Anonymous authentication is already enabled, but still the same issue. – Joem Orcullo May 30 '20 at 14:15
  • I have referred to this answer (https://stackoverflow.com/a/38917421/6763912). Though for the `SqlDependency.Stop` and `SqlDependency.Start`, I put them on Globals.asax – Joem Orcullo May 30 '20 at 15:38
  • Is it working for you now? – vinothvs May 30 '20 at 23:15
  • @vinothvs nope not yet – Joem Orcullo May 31 '20 at 12:50
  • Where is your SQL Server? Can you verify your connection string? If the code works at local and not after IIS i can think of only two possibilities. One either you may lack permission, or the IIs is not able to reach to your DB server or viceversa. You should not look at your code :) – vinothvs May 31 '20 at 13:12

1 Answers1

0

To find the root cause, we need to dig the exception. First of all , please check your event viewer.

If there is any exception thrown from .net runtime, you will find it. If no exception can be found in event viewer. It might be a first chance exception. Then you need to collect dump file with debug diagnostic collection and analyze the dump file with WINDBG.

How to use the Debug Diagnostics Tool

Debug Diagnostic Tool

samwu
  • 3,857
  • 3
  • 11
  • 25