使用SlowCheetah和自定义配置时的Azure Worker角色配置问题

问题描述:

我们使用Nlog作为日志工具和我们的Azure应用程序的工作者角色。 它需要NLog.config文件。我们安装了“SlowCheetah-XML Transforms”,并且有两个Debug/Release转换)。使用SlowCheetah和自定义配置时的Azure Worker角色配置问题

解决方案确实获得重建成功。

但是,当我尝试运行时,我得到以下错误。 (我在我的Windows服务应用程序中使用了nolog.config的精确转换,并且在那里工作正常)。

错误163项目列表“OutputGroups” 中的项目“bin \ Debug \ NLog.config”未定义元数据“TargetPath”的值。为了使用 此元数据,要么通过指定 %(OutputGroups.TargetPath)来限定它,要么确保此列表中的所有项目 都为此元数据定义一个值。 C:\ Program Files文件 (86)\的MSBuild \微软\ VisualStudio的\ V10.0 \ Windows Azure的 工具\ 1.6 \ Microsoft.WindowsAzure.targets 2299 5 Insight.CloudWeb

我不知道,如果这是由SlowCheetah扩展完成的,但是您可以验证您的* .csproj文件是否包含类似于此的AfterCompile目标?

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 

<UsingTask TaskName="TransformXml" 
    AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" /> 

<Target Name="AfterCompile" Condition="exists(’app.$(Configuration).config’)"> 
    <TransformXml Source="NLog.config" 
    Destination="$(IntermediateOutputPath)$(TargetFileName).config" 
    Transform="NLog.$(Configuration).config" /> 
    <ItemGroup> 
    <AppConfigWithTargetPath Remove="NLog.config"/> 
    <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config"> 
     <TargetPath>$(TargetFileName).config</TargetPath> 
    </AppConfigWithTargetPath> 
    </ItemGroup> 
</Target> 

看看奥列格的博客文章.Config File Transformationapp.config文件转换以获取更多信息。

+0

我认为你的建议只有在我完全删除slowcheetah时才有效。我会尝试一旦我无法获得使用SlowCheetah插件的工作。谢谢。 – 2012-08-04 05:54:27

我对此有一个修复。现在,您应该可以使用SlowCheetah转换app.config以及Azure Worker角色的其他XML文件。一旦我得到修复验证,我将发布VS画廊的更新。

如果您想尝试修复,您可以在https://dl.dropbox.com/u/40134810/SlowCheetah/issue-44/SlowCheetah-issue-44.zip下载更新的VSIX。如果您有兴趣跟进此事,请使用issue #44