When reflected information is required on a specific type, I often store the information (post retrieval and processing) on a private static field of whatever class I am doing the work. In the past, in certain situations, after some changes where made to the class, the statically cached reflection data would be stale (no longer reflected the class current metadata). The context being an ASP.net application, I would reset IIS or recycle the intended app pool and the data would now get retrieved correctly. Given that IIS automatically recycles the app pool if any changes are made to either the web.config or the bin folder, How was that cached data hanging around? In other words, How could I replicate that on an instance of IIS with standard configuration ?
The .net is question is .net framework 4.8. The IIS in question is IIS 10 on Windows 10 Professional.
The exact sequence of events as I understand it were: Class SomeBusinessService was decorated with MySpecialAttribute [MySpecial]. Dev runs the app on IIS. Dev makes a change to SomeBusinessService and adds a second attribute [MySecond] to the class. Dev builds solution on Visual Studio 2019. The output target is the actual folder where IIS runs from (thus changing the bin folder). When Dev runs the app again, the static field is already populated, thus old information is used.