My aspnet_regsql.exe is broken setting cache dependency RRS feed

  • Question

  • User-1480131104 posted


    While doing a tutorial on cache dependency I ran into problems.
    The error from the debugger was that my database was not setup for cache dependency.

    So I searched on the web and found out you could use aspnet_regsql to fix that.

    So I executed this from the cmd:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe -S localhost\sqlexpress -E -d Pubs -ed

    And I got this responce from the prompt:
    Enabling the database for SQL cache dependency.


    All looked fine I thought and I runned the app again.

    Again the debugger called me back saying I had to setup the table for cache dependency as well.

    So I called the prompt again and pasted in another command but it didn't work the prompt gave me:
    C:\....aspnet_regsql.exe is not a valid win32 applicaition and in the prompt an: "Access denied"

    I thougth how strange so I looked up the exe to start it up manualy.
    Again I received the same error. (And a half hour ago the wizard (UI) still worked by doubleclicking the exe file.....)

    Close examination of my Windows explorer showed that the exe has been changed 5 minutes ago. (The time I set SQL dependency on the pubs table...)
    And to get more spooky the file is now only 0kb large???

    So somehow I feel I killed this exe file and I have no clue on how to fix it. Perhaps I should reïnstall the Framework but I'm not sure if that is a wise thing to do.

    Someone got a clue?


    Wednesday, November 23, 2005 3:27 PM

All replies

  • User-429982059 posted
    You also have to set up your web.config to tell your app what you want to depend on.

    Link will help : http://www.ondotnet.com/pub/a/dotnet/2005/01/17/sqlcachedependency.html

    Wednesday, November 23, 2005 4:04 PM
  • User-1480131104 posted
    You also have to set up your web.config to tell your app what you want to depend on.

    Link will help : http://www.ondotnet.com/pub/a/dotnet/2005/01/17/sqlcachedependency.html

    Hi Eric,

    Thank you for your answer.

    That's funny that's actually the same tutorial I was following to Fix my problems I ran in to following ScottGu's excellent tutorial voor Visual Studio tools and SqlServer (Which I have to alter from now and then to comply with VWD rules and SQLExpress) Hate the tracking cookies on that site BTW... [;)]

    But I don't think the issue is how to set up SQL dependency...the tutorials are pretty ok to follow. (Excellent...)

    But the thing is with the Exe file that is broken  now so I can't set dependency anymore to the table. (Database dependency was succesfull)

    So somhow I Fubar't it and now I'm trying to find out how to fix that registering tool to set dependency on the Authors table.

    Wednesday, November 23, 2005 5:28 PM
  • User-429982059 posted
    So you do have the settigns in your web config?  I dont get how you just messed up your tool.  That sounds very odd.  You could just replace it with a working one.  Are you seeing the pubs make records to look at your dbs or tables?  If so then it is working and your app is just not getting the results back.
    Wednesday, November 23, 2005 7:24 PM
  • User-1480131104 posted

    Hi Eric,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    <o:p> </o:p>

    Thank you for your answer.<o:p></o:p>

    <o:p> </o:p>

    Yes I have and I also added the correct page directives in the calling page (.aspx) as well.<o:p></o:p>

    <o:p> </o:p>

    Again I have to emphasis that the problem is with the aspnet_regsql.exe. After the successful setup for cache dependency on the pubs database the tool went dead.<o:p></o:p>

    <o:p> </o:p>

    If you double-click it then you are supposed to get a UI to change some general stuff on databases. But now (after using the tool to set cache dependency) if you try to use it (by double-clicking it or by the cmd) you get the following error: “C:\....aspnet_regsql.exe is not a valid win32 application”<o:p></o:p>

    <o:p> </o:p>

    IMO this is telling me that the aspnet_regsql.exe is corrupted.<o:p></o:p>

    <o:p> </o:p>

    Like I said before the file size of the exe is now 0 kb and the change to that size has the time stamp of the usage of the tool to set cache dependency on the “pubs” database.<o:p></o:p>

    <o:p> </o:p>

    With that knowledge I’m sure the tools is broken and perhaps someone can tell me what is the correct file size of that tool. (cause mines 0 kb now…) <o:p></o:p>

    You say replace it with a new one? Do you have a copy of a working one for me? Or a download URL for just that tool?<o:p></o:p>

    <o:p> </o:p>


    Thursday, November 24, 2005 6:34 AM
  • User-429982059 posted
    Try doing a search on the VS 2005 CD.
    Thursday, November 24, 2005 7:36 AM
  • User-1480131104 posted

    Hi Eric,

    Sorry don't use that Tool.

    I'm trying VWD Express for now with SQLExpress 2005 and if that works well I think about buying the full tool.

    Any other downloading source?

    Thank you

    Thursday, November 24, 2005 8:22 AM
  • User-429982059 posted
    That tool actually comes with the 2.0 framework so you could just reinstall the framework.
    Thursday, November 24, 2005 8:17 PM
  • User-1634877164 posted
    It sounds like the exe got corrupted somehow.  Have you run an anti-virus program on your system lately?  The way the .exe turned into a 0 byte file sounds suspiciously like sometype of virus problem.

    As eramseur mentioned, the asnet_regsql.exe tool is installed by the .NET Framework 2.0 redist.  One way to fix things would be to re-install it.

    Hope this helps,


    P.S. Once you enable the database for sqlcachedependencies, you'll then want to run a second command (I think it is the -t flag with aspnet_regsql.exe, although I'm on a relative's PC right now so can't easily check) that will allow you to specify which table to enable.
    Friday, November 25, 2005 5:45 PM
  • User-1480131104 posted

    Hi Eric and Scott,

    Well the exe file is corrupt for sure but I don't think it has anything todo with a virusscan.

    Like I mentioned in my first post it got corrupted setting the dependency on the database itself and after trying todo the same for the author tabel windows didn't recognize it anymore. (and the file was changed to 0 kb size)

    I'm still running the Beta 2 versions of all products so I think it's time to upgrade to the final release that came out 7 november. (haven't had time to set that up but will soon)

    Thanx to the both and I think reinstalling will fix the problem. I'll mark this one solved.

    Saturday, November 26, 2005 3:45 PM
  • User-1480131104 posted
    Hi Eric and Scott,

    It's all working now thanx to you both for helping!
    I've installed the final release of all express products and now the tool is working brilliantly...

    I've succesfully setup my database pubs for cache depency with the following cmd prompt:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe -S localhost\sqlexpress -E -d Pubs -ed

    And after that setup the Authors table with the following prompt:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe -S localhost\sqlexpress -E -t authors -d Pubs -et

    The test page has the following page directives:
    <%@ OutputCache Duration="55" SqlDependency="webcastdemo:authors" VaryByParam="state" %>

    This is normal caching set up to refresh after 55 seconds or a change in the State parameter. (querystring)
    The SQLDependency is set to webcastdemo:authors.

    This needs the following modification in your Web.config:
    Under the configuration node add:


    <add name="AppConnectionString1" connectionString="server=(local)\sqlExpress;Integrated Security=True;Database=pubs" providerName="System.Data.SqlClient" />

    <add name="SqlHealthMonitoring" connectionString="Server=(local)\sqlExpress;Integrated Security=True;Database=ASPNET" providerName="System.Data.SqlClient" />


    And under the System.web node add:


    <sqlCacheDependency enabled="true" pollTime="1000">


    <add name="webcastdemo" connectionStringName="AppConnectionString1"/>




    But better yet follow that excellent tutorial by Scott Guthrie on: (or the other tutorials)

    This one has helped me the most in exploring ASP.NET 2.0

    Again thanx to the both of you for helping me!

    Sunday, November 27, 2005 7:58 PM
  • User1477320052 posted

    Hi Joost,

    I got the same problem yesterday. The tool ran fine two times but then the third time it stareed saying that it is not a valid Win32 application. I checked, the file size was 0KB.

    Did you find any solution to this problem. I think reinstalling thw whole framework is not a good option.

    *And the tool is not a part of any beta or express product suite. It was installed with VS 2010 Professional (with SP1).

    Friday, November 23, 2012 1:07 AM