应用程序与“发布”工作正常,但自定义解决方案配置遇到错误 [英] Application working fine with “Release” but custom solution configurations encounter bugs
问题描述
我定期在不同的环境中部署mvc应用程序,因为所有环境都有不同的```web.config```,所以我在适当的环境中为不同的分支使用不同的不同发布配置文件。
问题是,当我使用```Release```配置时,应用程序运行正常,但是当我使用我使用的任何自定义构建配置时,它都有不同的```web.config` ``使用````xdt:transform```,如果我使用```Release```解决方案配置,那么应用程序的一些模块将停止工作,
将再次开始工作。
我有b
1. 比较两个配置文件中的已发布目录,并且两边都没有孤儿。
2.比较``.csproj``中配置文件的配置文件
```Release```配置
&NBSP; < PropertyGroup Condition =" '$(配置)| $(平台)'=='发布| AnyCPU'">
&NBSP; < DebugType> pdbonly< / DebugType>
&NBSP; < Optimize> true< / Optimize>
&NBSP; < OutputPath> bin \< / OutputPath>
&NBSP; < DefineConstants> TRACE< / DefineConstants>
&NBSP; < ErrorReport>提示< / ErrorReport>
&NBSP; < WarningLevel> 4< / WarningLevel>
&NBSP; < IncludeIisSettings> false< / IncludeIisSettings>
&NBSP; < IncludeAppPool> true< / IncludeAppPool>
&NBSP; < DesktopBuildPackageLocation> \\vm02\QABuilds< / DesktopBuildPackageLocation>
&NBSP; < DeployIisAppPath> PROJ / MYAPP.MVC< / DeployIisAppPath
&NBSP; < DeployIisAppPhysicalPath> D:\ TestDeploy\MYAPP.MVC< / DeployIisAppPhysicalPath>
&NBSP; < Prefer32Bit> false< / Prefer32Bit>
&NBSP; < FilesToIncludeForPublish> AllFilesInTheProject< / FilesToIncludeForPublish>
&NBSP; < / PropertyGroup>
自定义配置
&NBSP; < PropertyGroup Condition ="'$(Configuration)| $(Platform)'=='DevOpsCustom | AnyCPU'">
&NBSP; &NBSP; &NBSP; < DebugType> pdbonly< / DebugType>
&NBSP; &NBSP; &NBSP; <优化> true< / Optimize>
&NBSP; &NBSP; &NBSP; < OutputPath> bin \< / OutputPath>
&NBSP; &NBSP; &NBSP; < DefineConstants> TRACE< / DefineConstants>
&NBSP; &NBSP; &NBSP; < ErrorReport>提示< / ErrorReport>
&NBSP; &NBSP; &NBSP; < WarningLevel> 4< / WarningLevel>
&NBSP; &NBSP; &NBSP; < IncludeIisSettings> false< / IncludeIisSettings>
&NBSP; &NBSP; &NBSP; < IncludeAppPool> true< / IncludeAppPool>
&NBSP; &NBSP; &NBSP; < DesktopBuildPackageLocation> \\vm02\QABuilds< / DesktopBuildPackageLocation>
&NBSP; &NBSP; &NBSP; < DeployIisAppPath> PROJ / MYAPP.MVC< / DeployIisAppPath>
&NBSP; &NBSP; &NBSP; < DeployIisAppPhysicalPath> D:\ TestDeploy\MYAPP.MVC< / DeployIisAppPhysicalPath>
&NBSP; &NBSP; &NBSP; < Prefer32Bit> false< / Prefer32Bit>
&NBSP; &NBSP; &NBSP; < FilesToIncludeForPublish> AllFilesInTheProject< / FilesToIncludeForPublish>
&NBSP; &NBSP; < / PropertyGroup>
我需要问的是我还能检查什么,我尝试删除和制作自定义新鲜的配置文件,但没有运气。我想不出另一个有效管理多个```web.config```文件的解决方案。任何帮助将不胜感激。
I am deploying a mvc application on different environments regularly and as all environments have different ```web.config``` , so I use different different publish profiles for different branches for appropriate environments.
Problem is when I use ```Release``` configuration, application works fine, but when I use any of my custom build configuration that I use to have different ```web.config``` using ```xdt:transform```, some of the modules of Application stop working that will
start working again if I use ```Release``` solution configuration.
I have
1. compared published directory from both profiles in beyond compare and there are no orphans on either side.
2. compared configuration of configuration profiles in ```.csproj``` file
```Release``` configuration
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IncludeIisSettings>false</IncludeIisSettings>
<IncludeAppPool>true</IncludeAppPool>
<DesktopBuildPackageLocation>\\vm02\QABuilds</DesktopBuildPackageLocation>
<DeployIisAppPath>PROJ/MYAPP.MVC</DeployIisAppPath
<DeployIisAppPhysicalPath>D:\TestDeploy\MYAPP.MVC</DeployIisAppPhysicalPath>
<Prefer32Bit>false</Prefer32Bit>
<FilesToIncludeForPublish>AllFilesInTheProject</FilesToIncludeForPublish>
</PropertyGroup>
Custom Configuration
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DevOpsCustom|AnyCPU'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<IncludeIisSettings>false</IncludeIisSettings>
<IncludeAppPool>true</IncludeAppPool>
<DesktopBuildPackageLocation>\\vm02\QABuilds</DesktopBuildPackageLocation>
<DeployIisAppPath>PROJ/MYAPP.MVC</DeployIisAppPath>
<DeployIisAppPhysicalPath>D:\TestDeploy\MYAPP.MVC</DeployIisAppPhysicalPath>
<Prefer32Bit>false</Prefer32Bit>
<FilesToIncludeForPublish>AllFilesInTheProject</FilesToIncludeForPublish>
</PropertyGroup>
What I need to ask is what else I can check, I have tried deleting and making custom profiles from fresh but with no luck. I can't think of another solution to efficiently manage multiple ```web.config``` files. Any help would be appreciated.
推荐答案
嗨朋友,
欢迎来到MSDN论坛。
>> 应用程序的某些模块停止工作
有没有错误信息?如果您在此处分享,详细的错误消息可以提供很大的帮助。
您使用的部署方式,VS IDE或命令行?
如果使用命令行,它的格式是什么?它看起来像"msbuild.exe xxx.csproj ... / p:Configuration = DevOpsCustom / p:DeployAfterBuild = true"。
什么是更多,在csproj文件中,确保只有两个节点包含"DevOpsCustom",如下所示:
<None Include="Web.DevOpsCustom.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<PropertyGroup Condition="'
(配置)|
(平台)'=='DevOpsCustom | AnyCPU'" ;>
...
< / PropertyGroup> &NBSP; &NBSP; &NBSP;
(Platform)' == 'DevOpsCustom|AnyCPU'"> … </PropertyGroup>
最后,请您分享一下关于web中转换语法的简单示例。 DevOpsCustom.config文件(如果存在),以便我们可以直接检查
你。
期待收到您的回复!
MSDN社区支持请记住点击"标记为答案&";解决了您的问题的回复,并点击"取消标记为答案& quot;"如果不。这对阅读此主题的其他社区成员有益。
如果您对MSDN支持有任何称赞或投诉,请随时联系MSDNFSF@microsoft.com。
这篇关于应用程序与“发布”工作正常,但自定义解决方案配置遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!