Are JPG, DOC, PDF, etc, files also compiled into an assembly?

喜夏-厌秋 提交于 2019-12-22 11:29:29

问题


Q1:

  1. Does aspnet_compiler.exe compile into assembly(ies) all files contained inside the website directory, even JPG, DOC, and PDF types?

  2. If you add images to the list of files (thus add them to the project file) in your web project, will these images also get compiled by VS into assembly?

Q2:

When aspnet_compiler.exe compiles application into assembly(ies), it also compiles resources and web references.

  1. I’m not sure I understand what is meant by “Web references being compiled”. What kind of Web references is the text talking about?
  2. Text also mentions that Resources too get compiled. Which files are considered a resource? Just non-ASP.Net files, such as JPG, DOC etc?

thanx


EDIT:


However, I must ask, why do you want to have these files embedded in an assembly in the first place? Maybe you're not going in the right direction..

I don't plan to embed files in an assembly, but I wasn't sure whether or not this happens automatically when Asp.Net compiles a WebSite or WebProject


Anyways, thank you both for your help


回答1:


Q1

A) No, they keep their filename and are outside of the assembly.

B) No, they keep their filename and are outside of the assembly.

Q2

A) Web References refer to web services that are referenced to in your project. When you add a Web Reference, a proxy is generated to handle the communicatino with the service. That proxy needs to be compiled with your project (the proxy is auto-generated so you don't need to worry about it).

B) Resource files are *.resx included in your project. The most common use for resource files in a web application is internationlization. Those files do get compiled into your application.




回答2:


1A: No, content files can only be added to the generatad assembly if you specify "Embedd resource" as compile action on them

1B : The same as 1A

2 : A file must be marked as "Embedded resource" to get compiled into the assembly.

However, I must ask, why do you want to have these files embedded in an assembly in the first place? Maybe you're not going in the right direction..



来源:https://stackoverflow.com/questions/786996/are-jpg-doc-pdf-etc-files-also-compiled-into-an-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!