如何确定我的构建提供程序正在构建的类型(类)的实际文件名(App_Code_xxx.dll)。
例如,我有一个构建提供程序,它根据某些配置注入类。说 MyNameSpace.MyClass。当 Web 应用程序使用此构建提供程序时。我只想知道临时文件中的 asp_net.dll 在磁盘上编译的实际文件(.dll)。
从真正意义上来说,我什至想控制这个文件的命名。
提前致谢。
穆罕默德
How can I determine the actual filename (App_Code_xxx.dll) of the types (classes) which is being built by my build provider.
For instance I have a build provider which injects classes based on some configuration. Say MyNameSpace.MyClass. When this build provider is consumed by the Web App. I just want to know the actual file(.dll) which was compiled on the disk by asp_net.dll in temporary files.
In true sense I even want to control the naming for this file.
Thanks in Advance.
Mohammed
发布评论
评论(2)
我从来不喜欢 Visual Studio 2005 附带的网站构建方法,每次构建时都会创建一个名为 App_Code_xxx.dll 的新文件,使用它非常痛苦。
Visual Studio 2005 SP1(及更高版本)有一个 Web 应用程序,它将您的项目构建为单个 .dll(就像在 .net 1.1 中所做的那样)并且更容易使用,我建议将您的网站转换为 Web 应用程序。教程可在此处和此处
这样您就不必担心写入磁盘上的文件名
I never liked the website build approach that came with Visual Studio 2005 that created a new file named App_Code_xxx.dll every time you build, it's just pain to work with it.
Visual Studio 2005 SP1 (and later versions) have a web application which builds your project into a single .dll (like was done in .net 1.1) and is much easier to work with, I would recommend comverting your website to web application. Tutorials are available here and here
This way you don't have to worry about the filename that was written on disk
假设YourClass是在YourDll.dll中定义的,那么你可以使用以下代码:
Assuming that YourClass is defined in YourDll.dll, then you can use the following code: