![](/img/trans.png)
[英]Is it possible to add routes other that Application_start Event in asp.net web forms
[英]How to add routes to a 3rd party asp.net application, when no access to Application_Start is available
我有一個第三方Asp.net(.NET 4.0)Web應用程序,負責開發其他內容。 我需要能夠使用MVC和WebApi,因此我必須能夠映射路由。
有沒有我可以訪問Application_Start的方法(我沒有他們的源代碼)?
否,但是,如果您具有IIS訪問權限,則可以使用iis url重寫規則。 在iis.net中的IIS“ URL重寫”中檢查此模塊
您可以使用新的
[assembly: PreApplicationStartMethod(typeof(XYZ.SomeClassType), "InitializeCASHttpModule")]
執行此操作的屬性。
將dll放入第三方網站Bin目錄中,然后重新啟動它的應用程序池。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.