我有一个网站,而不是一个Web应用程序项目,在发布模式下发布时,我的Web.Release.config不会用于转换。
事实上,我甚至无法在解决方案资源管理器中右键单击Web.config并测试我认为我可以在Visual Studio 2012中进行的转换。
我甚至安装了“SlowCheetah”扩展程序来尝试测试转换,但是当我右键单击解决方案资源管理器中的Web.config时,没有可用的SlowCheetah选项,是的,我已经重新启动了Visual Studio 2012。
这是我目前的Web.release.config:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="S3BUCKET" value="xxxxxx" xdt:Transform="SetAttributes"
xdt:Locator="Match(key)"/>
</appSettings>
<connectionStrings>
<add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="Email" connectionString="Server=xxxxxxxxxx;Database=xxxxxxxxxx_Email;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />
<add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="Default" connectionString="Server=xxxxxxxxxx;Database=xxxxxxxxxx_App;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />
<add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="Logging" connectionString="Server=xxxxxxxxxx;Database=xxxxxxxxxx_Log;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />
<add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="NegotiationConn" connectionString="Server=xxxxxxxxxx;Database=Neo_AppDBv2;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />
<add xdt:Transform="SetAttributes" xdt:Locator="Match(name)" name="NegotiationContext" connectionString="metadata=res://*/DAL.NegotiationModel.csdl|res://*/DAL.NegotiationModel.ssdl|res://*/DAL.NegotiationModel.msl;provider=System.Data.SqlClient; provider connection string=" data source=xxxxxxxxxx; initial catalog=Neo_AppDBv2; persist security info=True; Integrated Security=True; MultipleActiveResultSets=True; App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<EntitySpaces>
<connectionInfo default="CurAppDB">
<connections>
<add xdt:Transform="SetAttributes" name="LookUpDB" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL" provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider" connectionString="Server=xxxxxxxxxx;Database=LookUpDB;Trusted_Connection=Yes;" databaseVersion="2008" />
<add xdt:Transform="SetAttributes" name="SynProDB" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL" provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider" connectionString="Server=xxxxxxxxxx;Database=SyndPropPoint2;Trusted_Connection=Yes;" databaseVersion="2008" />
<add xdt:Transform="SetAttributes" name="CurAppDB" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL" provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider" connectionString="Server=xxxxxxxxxx;Database=xxxxxxxxxx_App;Trusted_Connection=Yes;" databaseVersion="2008" />
<add xdt:Transform="SetAttributes" name="NeoDBv2" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL" provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider" connectionString="Server=xxxxxxxxxx;Database=Neo_AppDBv2;Trusted_Connection=Yes;" databaseVersion="2008" />
<add xdt:Transform="SetAttributes" name="MlsFormsDB" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL" provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider" connectionString="Server=xxxxxxxxxx;Database=MLS_Forms;Trusted_Connection=Yes;" databaseVersion="2008" />
</connections>
</connectionInfo>
</EntitySpaces>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)">
<buildProviders xdt:Transform="Remove">
<remove extension=".xml" />
<remove extension=".config" />
<add extension=".xml" type="System.Web.Compilation.IgnoreFileBuildProvider" />
<add extension=".config" type="System.Web.Compilation.IgnoreFileBuildProvider" />
</buildProviders>
</compilation>
<xhtmlConformance mode="Transitional" xdt:Transform="Remove" />
<httpRuntime xdt:Transform="Replace" requestValidationMode="2.0" maxRequestLength="12288" enableVersionHeader="false" />
<!--12288 kilobytes = 12 megabytes-->
<machineKey xdt:Transform="Insert" validationKey="xxx" decryptionKey="xxxxxx" validation="SHA1" decryption="AES" />
<authentication xdt:Transform="Replace" mode="Windows" />
<identity impersonate="true" userName="xxxxx" password="xxxxxx"/>
<!--<identity xdt:Transform="Replace" configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>xxxxxx</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>xxxxxx</CipherValue>
</CipherData>
</EncryptedData>
</identity>-->
<httpRuntime xdt:Transform="Insert" requestValidationMode="2.0" maxRequestLength="12288" enableVersionHeader="false" />
<httpHandlers xdt:Transform="Insert">
<add verb="GET" path="FtbWebResource.axd" type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" />
<add path="DESGetFiles.axd" verb="GET" type="PeterBlum.DES.Web.GetFilesHandler, PeterBlum.DES, Version=5.0.4.5000, Culture=neutral, PublicKeyToken=cb5182303c90db58" />
</httpHandlers>
<httpModules xdt:Transform="Insert">
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
</httpModules>
</system.web>
<system.webServer>
<handlers>
<add name="name" path="DESGetFiles.axd" verb="GET" type="PeterBlum.DES.Web.GetFilesHandler, PeterBlum.DES, Version=5.0.4.5000, Culture=neutral, PublicKeyToken=cb5182303c90db58" />
<remove xdt:Transform="Remove" name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove xdt:Transform="Remove" name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove xdt:Transform="Remove" name="ExtensionlessUrlHandler-Integrated-4.0" />
<add xdt:Transform="Remove" name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add xdt:Transform="Remove" name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add xdt:Transform="Remove" name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<validation xdt:Transform="Insert" validateIntegratedModeConfiguration="false" />
<modules xdt:Transform="Replace" runAllManagedModulesForAllRequests="false">
<!-- Only thing being transformed here is runAllManagedModulesForAllRequests="true" to runAllManagedModulesForAllRequests="false" -->
<add name="HTTPHandlerAppErrors" type="xxxxxxxxxx.AppCode.HTTPHandlerAppErrors, xxxxxxxxxx.AppCode" preCondition="managedHandler" />
</modules>
<httpErrors xdt:Transform="Replace" errorMode="DetailedLocalOnly" />
<staticContent xdt:Transform="Insert">
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
</staticContent>
<rewrite xdt:Transform="Insert">
<rules>
<rule name="Sitemap Redirect" enabled="true" stopProcessing="true">
<match url="sitemap\.xml" />
<conditions>
<add input="{HTTP_HOST}" pattern="www\.(.*?)\.com" />
</conditions>
<action type="Rewrite" url="/sitemap-{C:1}.xml" />
</rule>
<rule name="Robots txt Redirect" enabled="true" stopProcessing="true">
<match url="robots\.txt" />
<conditions>
<add input="{HTTP_HOST}" pattern="www\.(.*?)\.com" />
</conditions>
<action type="Rewrite" url="/robots-{C:1}.txt" />
</rule>
</rules>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Remove">
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<!--**************************************************************************************-->
<!--Dotnet OpenAuth-->
<dotNetOpenAuth xdt:Transform="Replace">
<messaging>
<untrustedWebRequest>
<whitelistHosts>
<!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
<!--<add name="localhost" />-->
</whitelistHosts>
</untrustedWebRequest>
</messaging>
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
<reporting enabled="true" />
<openid>
<relyingParty>
<security requireSsl="false">
<!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
<!--<trustedProviders rejectAssertionsFromUntrustedProviders="true">
<add endpoint="https://www.google.com/accounts/o8/ud" />
</trustedProviders>-->
</security>
<behaviors>
<!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
with OPs that use Attribute Exchange (in various formats). -->
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" />
</behaviors>
</relyingParty>
</openid>
</dotNetOpenAuth>
<!--**************************************************************************************-->
<!--**************************************************************************************-->
<!--Config for Homevana Service References, not really needed in Homevana config but the services are part of
xxxxxxxxxx.AppCode library so if they were ever called from Homevana for some reason...-->
<system.serviceModel xdt:Transform="Insert">
<bindings>
<basicHttpBinding>
<binding name="OfferServiceSoap" receiveTimeout="00:00:05" sendTimeout="00:00:05" />
<binding name="ConversationServiceSoap" receiveTimeout="00:00:05" sendTimeout="00:00:05" />
</basicHttpBinding>
<customBinding>
<binding name="OfferServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
<binding name="ConversationServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://192.168.0.23/Services/ConversationService.asmx" binding="basicHttpBinding" bindingConfiguration="ConversationServiceSoap" contract="ServiceReferenceConversation.ConversationServiceSoap" name="ConversationServiceSoap" />
<endpoint address="http://192.168.0.23/Services/ConversationService.asmx" binding="customBinding" bindingConfiguration="ConversationServiceSoap12" contract="ServiceReferenceConversation.ConversationServiceSoap" name="ConversationServiceSoap12" />
<endpoint address="http://192.168.0.23/Services/OfferService.asmx" binding="basicHttpBinding" bindingConfiguration="OfferServiceSoap" contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap" />
<endpoint address="http://192.168.0.23/Services/OfferService.asmx" binding="customBinding" bindingConfiguration="OfferServiceSoap12" contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap12" />
</client>
</system.serviceModel>
<!--///////////*****************************************************-->
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory" xdt:Transform="Remove">
<specifiedPickupDirectory pickupDirectoryLocation="~\MailPickup" />
</smtp>
</mailSettings>
</system.net>
<uri xdt:Transform="Remove">
</uri>
</configuration>
这些是我对网站项目的构建选项:
我也没有选择将解决方案属性中的构建配置更改为发布:
我的发布配置文件设置为发布: