开发者

PostSharp build targets not running when using Debug configuration

I have setup a Visual Studio project that I have edited to reference the PostSharp build targets. I did not use the MSI installe开发者_运维知识库d to install PostSharp on my development machine.

The problem that I am having is that the PostSharp Targets are only executed when I change the build configuration to 'Release', but not in 'Debug'.

I can verify this by looking at the build output which includes the line when in Release:

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

Looking at the project file, I do not see anything obvious that would suggest PostSharp would run with one configuration and not the other. How can I configure PostSharp to run during both Debug and Release configuration? Keeping in mind, I would rather avoid using the installer.

Karl

EDIT csproj snippent, appears at the bottom of file, below <ItemGroup>:

<PropertyGroup>
    <DontImportPostSharp>True</DontImportPostSharp>
    <PostSharpDirectory>..\..\tools\postsharp-1.5.6.629</PostSharpDirectory>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(PostSharpDirectory)\PostSharp-1.5.targets" />


Look at the location of the <Import> element in the project file that imports PostSharp.targets. There are normally three <PropertyGroup> elements in the project file. One for general settings, one for Debug only settings and one for Release only settings. Move the <Import> element if it is in the Release group, it should appear after the Import element for Microsoft.CSharp.targets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜