Why is this assembly a temporary asp.net dll?

2019-09-11 03:41发布

问题:

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?

回答1:

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.



回答2:

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"