OnExit 未通过 asp.net 项目中的 PostSharp 进入

发布于 2024-08-02 08:52:28 字数 2134 浏览 6 评论 0原文

我已经设置了 PostSharp,它似乎正在工作,但我没有让它进入 OnExit(我已记录设置以确保它正在工作)...

使用 asp.net 配置有点棘手 - 或者只是我。 ..我使用的是 1.5 新版本

,我的 web.config 中基本上有以下内容,我必须添加 SearchPath,否则它无法找到

  <postsharp directory="C:\Program Files\PostSharp 1.5" trace="true">
   <parameters>
     <!--<add name="parameter-name" value="parameter-value"/>-->
   </parameters>
   <searchPath>
     <!-- Always add the binary folder to the search path. -->
     <add name="bin" value="~\bin"/>
   </searchPath>

 </postsharp>

我设置了跟踪的程序集,但对我来说奇怪的是,它似乎构建到临时目录,也许这是我的问题,我不确定..因此我执行 F5 ...是否可以命名输出目录和输出文件?正如你所看到的,它正在临时目录中编辑一个 DLL,因此 IIS 不再受控制,因此它不会执行它???

使困惑! :-)


C:\Program Files\PostSharp 1.5\postsharp.exe "/P:Output=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\ postsharp\App_Web_04ae3ewy.dll" "/P:IntermediateDirectory=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp " /P:CleanIntermediate=False / P:参考目录=。 /P:SignAssembly=False /P:PrivateKeyLocation= /P:ResolvedReferences= "/P:SearchPath=C:\Source Code\Visual Studio 2008\Projects\mysitemvc\mysitemvc\bin," /V /SkipAutoUpdate "C:\Program文件\PostSharp 1.5\Default.psproj"“C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\before-postsharp\App_Web_04ae3ewy.dll”

PostSharp 1.5 [ 1.5.6.627] - 版权所有 (c) Gael Fraiteur,2005-2009。

信息 PS0035:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ ilasm.exe“C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \临时ASP.NET文件\ mysitemvc-1.2 \ c2087140 \ 8ac2dc93 \postsharp\App_Web_04ae3ewy.il" /QUIET /DLL /PDB "/RESOURCE=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy。 res" "/OUTPUT=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy.dll" /SUBSYSTEM=3 /FLAGS=1 /基数=18481152 /堆栈=1048576 /对齐=512 /MDV=v2.0.50727

I have setup PostSharp and it appears to be working but i don't get it entering OnExit (i have logged setup to ensure it is working) ...

Its a bit tricky to configure with asp.net - or is it just me ... I am using the 1.5 new version

I basically have the following in my web.config and i had to add the SearchPath otherwise it can't find my assemblies

  <postsharp directory="C:\Program Files\PostSharp 1.5" trace="true">
   <parameters>
     <!--<add name="parameter-name" value="parameter-value"/>-->
   </parameters>
   <searchPath>
     <!-- Always add the binary folder to the search path. -->
     <add name="bin" value="~\bin"/>
   </searchPath>

 </postsharp>

I have set tracing on but what is strange to me is that it appears to build to the temp directory, maybe this is my issue, i am unsure .. hence i do F5 ... Is it possible to name the Output directory and output file?? As you can see it is editing a DLL in the temp dir so IIS is no longer in control so it doesn't execute it ???

Confused! :-)


C:\Program Files\PostSharp 1.5\postsharp.exe "/P:Output=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy.dll" "/P:IntermediateDirectory=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp " /P:CleanIntermediate=False /P:ReferenceDirectory=. /P:SignAssembly=False /P:PrivateKeyLocation= /P:ResolvedReferences= "/P:SearchPath=C:\Source Code\Visual Studio 2008\Projects\mysitemvc\mysitemvc\bin," /V /SkipAutoUpdate "C:\Program Files\PostSharp 1.5\Default.psproj" "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\before-postsharp\App_Web_04ae3ewy.dll"

PostSharp 1.5 [1.5.6.627] - Copyright (c) Gael Fraiteur, 2005-2009.

info PS0035: C:\Windows\Microsoft.NET\Framework\v2.0.50727\ilasm.exe "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy.il" /QUIET /DLL /PDB "/RESOURCE=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy.res" "/OUTPUT=C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mysitemvc-1.2\c2087140\8ac2dc93\postsharp\App_Web_04ae3ewy.dll" /SUBSYSTEM=3 /FLAGS=1 /BASE=18481152 /STACK=1048576 /ALIGNMENT=512 /MDV=v2.0.50727

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧城空念 2024-08-09 08:52:28

PostSharp.AspNet 实现 IAssemblyPostProcessor。路径是通过ASP.NET。 PostSharp 的作用是在 ASP.NET 传递的目录中创建一个临时子目录,将其输出写入其中,然后将输出复制回输入。

没有办法改变这个机制(而且我也看不出任何理由)。

PostSharp.AspNet implement IAssemblyPostProcessor. The path is passed ASP.NET. What PostSharp does it that it creates a temp subdirectory in this directory passed by ASP.NET, writes its output there, then copies the output back to the input.

There is no way to change this mechanism (and I don't see any reason anyway).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文