c# - Where do I register IMemoryCache in my ASP.NET application? -
i have asp.net web application created visual studio 2015 community edition. .net framework 4.6.1.
i have no idea version of asp.net web application using asp.net mvc 4? asp.net mvc 5? it's not mentioned anywhere.
i'm trying register imemorycache
service (from microsoft.extensions.caching.memory
) microsoft unity container. however, found on google refers adding services.addcaching()
in startup.cs
file.
i don't have startup.cs
file. see global.asax
. furthermor, custom dependencies registered within unityconfig.cs
provided when installing nuget package unity.mvc
microsoft unity bootstrapper asp.net microsoft.
any appreciated.
edit:
here's screenshot of project:
the things referring part of asp.net core (asp.net 5)
in new version no longer have global.asax file, have new startup processed defined in startup class. also, di standard, things work in different way now. either upgrade latest version of asp.net or apply use di solutions older version:
resolving dependencies in asp.net mvc 5 using unity container
also package using new asp.net version.
Comments
Post a Comment