Assembly Name for ASP.Net

I have Quartz.Net integrated to set the scheduler in my ASP.Net application.

But it does not work automatically and it seems that it was stopped when IIS reuses the Application Pool. But it works when sending a request to the server.

After reading the IIS app pool recycle + quartz scheduling, I am trying to configure the same thing on the IIS 7.5 server to solve this problem.

<serviceAutoStartProviders> <add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" /> </serviceAutoStartProviders> 

However, the PreWarmCache class was defined on my website and retained all the logic since it uses a template from web pages.

How can I define this class from a site in type ? What would be the value to MyAssembly ?

I can use the assembly name if my project is a web application.

I have created a website. So, what could be the meaning, or how do I configure this section?

Note. PreWarmCache is placed in the App_Code directory

+4
source share
2 answers

This has nothing to do with Quartz.Net, but is because the IIS server reuses the application pool after a period of inactivity.

I have the same problem, but all I am trying to do is cache data.

Therefore, I need to do the following in the applicationHost.config file:

 <serviceAutoStartProviders> <add name="PreWarmMyCache" type="PreWarmCache, MyAssembly" /> </serviceAutoStartProviders> 

Then a function is called that populates the XML document and saves it as a lookup table in the cache, which will be used as needed.

And the problem is that if I use the AssemblyQualifiedName attribute, it returns the following for my class:

 MyApp.PreWarmCache, App_Code.<#########>, Version=0.0.0.0, Culture=neutral, PublickKeyToken=null 

Where ######### is changed every time the code is compiled.

I do not want to separate this from the DLL, as this may lead to a repeated copy of the code.

So the question is the same.

Can I / provide an explicit assembly name for dynamically compiled ASP_ classes on an ASP.NET site?

This is fixed, the output code in a separate assembly, the compiled added link, now everything is complete.

0
source

It is highly recommended that you do not use Quartz.NET in your web application. Application pools can also be reset. Although you can plan to recycle them at a specific time, they can still recycle them at any time. This creates unpredictable behavior and will be difficult to track.

I highly recommend creating a Windows service to handle your Quartz.NET tasks. It will be more predictable, easier to debug and detach from your web application. This eliminates the difficulty of trying to constantly maintain the application pool to start the service.

If you still want to use Quartz.NET in your web application, then this SO question may help.

0
source

Source: https://habr.com/ru/post/1500477/


All Articles