Can*_*ğlu 55 publish web-config visual-studio-2010 visual-studio
我正在创建一个可发布的包,当我导航到obj\Debug\Package\PackageTmp目录时,我看到web.config的连接字符串被替换为可替换的令牌,我根本就不希望这样.我将不会使用发布批处理文件或任何东西,我将复制目录中的文件(我正在使用发布包系统,以便在我测试我的项目时获取大量动态生成的文件并获取我的项目的新/原始文件树)我不想要那些web.config标记和转换等,我只是希望我的web.config文件像任何其他文件一样被复制.我如何实现这一目标?我已经看到了/p:AutoParameterizationWebConfigConnectionStrings=Falsecommad行的方法,但我没有使用命令行,我正在使用GUI来创建包.如何阻止web.config将连接字符串更改为令牌?
在您说:是的之前,我知道我可以从原始目录中复制原始web.config,但我不想处理这个问题,我想在我测试时单击一下完成它发布包并经常重新创建包.
And*_*que 103
您必须编辑.csproj文件,并且在Debug PropertyGroup中您必须添加以下内容:
<AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
Run Code Online (Sandbox Code Playgroud)
我在Project.csproj中有Release和ReleaseCERT配置的以下内容(我只添加了AutoParameterizationWebConfigConnectionStrings行):
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == '**Release**|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<!-- add the following line to avoid ConnectionString tokenization -->
<AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '**ReleaseCERT**|AnyCPU'">
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<!-- add the following line to avoid ConnectionString tokenization -->
<AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
当我尝试根据Travis Illig指令在外部为WiX设置创建Web项目包时,我遇到了类似的问题.我通过添加到以下内容解决了它:AutoParameterizationWebConfigConnectionStrings=FalseMSBuild/@Properties
<MSBuild Projects="%(ProjectReference.FullPath)"
Targets="Package"
Properties="Configuration=$(Configuration);Platform=AnyCPU;AutoParameterizationWebConfigConnectionStrings=False"
Condition="'%(ProjectReference.WebProject)'=='True'"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12336 次 |
| 最近记录: |