Zack Peterson
Zack Peterson

Reputation: 57323

Can I map new routes to the RouteCollection outside Global.asax?

I'd like to occasionally map new routes to the RouteCollection during program execution long after the Global.asax RegisterRoutes() method had first executed.

How can I do this?

Upvotes: 2

Views: 568

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126547

It's possible, but the route collection is shared state in a multi-threaded app, so you have to get a lock. There's an example here.

Upvotes: 4

Related Questions