Load an Assembly from Bin in ASP.NET

后端 未结 4 2531
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 10:00

I have a file name, like \"Foo.dll,\" for a library that I know is in the bin directory. I want to create an Assembly object for it. I\'m trying to instantiate this object from

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-20 10:36

    From your description it sounds like this is an web application, so unless you are on an asynchronous thread you spawned from a request, you should still have access to the HttpContext. From there you can use Server.MapPath() to the file you need.

提交回复
热议问题