Why is this assembly a temporary asp.net dll?

2019-09-11 04:01发布

I have precompiled my web site project into a single dll for the whole site. When I run a page and look at:

Assembly.GetAssembly(this.GetType())

It is resolving as : App_Web_qgqyxtge

But when I make a call to:

Assembly.GetExecutingAssembly()

This resolves to :

Upload, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

I'm struggling to see why the assembly of the page I am looking at looks like a temporary asp.net dll and not the compiled dll that seems to be executing the current code?

2条回答
Fickle 薄情
2楼-- · 2019-09-11 04:16

Are you running the page in debug mode when you print out that message. The compilation model is different between release and debug. In deug there is on assembly pr page, so I would guess your page is called "Upload.aspx"

查看更多
3楼-- · 2019-09-11 04:20

That's probably because you are using a Web Site project in contrast to Web Application project and all classes stored in your App_Code folder will automatically be compiled into temporary assemblies.

查看更多
登录 后发表回答