[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Paul Hale

4/1/2009 4:54:00 PM

I have a workflow that runs within a web application (My workflows DLL is
copied to my web apps BIN folder). My web application has a number of items
cached. I would like to access these cached items from within my workflow.

I would of thought that as the Workflows dll runs within my web app it would
run in the same context and I should be able to access it. However this line
of code returns "Object ref not set to an instance of an object)...

int myCacheCount
myCacheCount= System.Web.HttpContext.Current.Cache.Count;

Does anybody know if you can access asp.net cache from within a WWF workflow
and if so how?

Paul.




2 Answers

Alvin Bruney [ASP.NET MVP]

4/6/2009 2:01:00 AM

0

I don't see how that is possible; these are two different engines. Build a
webservice or expose your cache via a public method. That should work.
Essentially, a function that returns context.current. current is not
guaranteed to be valid so this is the only gotcha.

--
Regards,
Alvin Bruney

Auther Plug
OWC Blackbook now on download at www.lulu.com/owc

"Paul Hale" <PaulHale@newsgroups.nospam> wrote in message
news:AF9B622E-304D-4353-9074-3C4DFA4366F4@microsoft.com...
> I have a workflow that runs within a web application (My workflows DLL is
> copied to my web apps BIN folder). My web application has a number of
> items
> cached. I would like to access these cached items from within my
> workflow.
>
> I would of thought that as the Workflows dll runs within my web app it
> would
> run in the same context and I should be able to access it. However this
> line
> of code returns "Object ref not set to an instance of an object)...
>
> int myCacheCount
> myCacheCount= System.Web.HttpContext.Current.Cache.Count;
>
> Does anybody know if you can access asp.net cache from within a WWF
> workflow
> and if so how?
>
> Paul.
>
>
>
>

Paul Hale

4/7/2009 4:24:00 PM

0

I have decided to go down a different route and access my cache from outside
my Workflow (after it is kicked off). Another approach would of been to use
App Cache Block that was suggested by a Workflow guru.

"Paul Hale" wrote:

> I have a workflow that runs within a web application (My workflows DLL is
> copied to my web apps BIN folder). My web application has a number of items
> cached. I would like to access these cached items from within my workflow.
>
> I would of thought that as the Workflows dll runs within my web app it would
> run in the same context and I should be able to access it. However this line
> of code returns "Object ref not set to an instance of an object)...
>
> int myCacheCount
> myCacheCount= System.Web.HttpContext.Current.Cache.Count;
>
> Does anybody know if you can access asp.net cache from within a WWF workflow
> and if so how?
>
> Paul.
>
>
>
>