2

I have a Website, NOT a Web Application Project and when Publishing in release mode, my Web.Release.config is not used in transformation.

In fact, I cannot even right click the Web.config in Solution Explorer and test the transformation which I thought I could do in Visual Studio 2012.

I even installed the "SlowCheetah" extension to try and test the transformation but when I right click the Web.config in Solution Explorer there is no options for SlowCheetah available, and yes I have restarted Visual Studio 2012.

This is my current 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=&quot;  data source=xxxxxxxxxx;  initial catalog=Neo_AppDBv2;  persist security info=True;  Integrated Security=True;  MultipleActiveResultSets=True;  App=EntityFramework&quot;" 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>

These are my build options for a Website project:

enter image description here

I also do not have an option to change the Build Configuration in the Solution Properties to Release: enter image description here

My Publish Profile is set to Release: enter image description here

Corey
  • 15,524
  • 2
  • 35
  • 68
Brian Ogden
  • 18,439
  • 10
  • 97
  • 176
  • Been here. Seen that. Just digging out the project to jog my memory. – spender Jan 21 '15 at 23:52
  • IIRC this is because you don't have a build configuration in the project that matches that name. In the project settings, under the build tab, are you sure you have a "Release" configuration? – spender Jan 21 '15 at 23:55
  • Thanks for the help!! I just added my Build options, I think you are on to something, you can only set the "build configuration" in the Web.config for a website – Brian Ogden Jan 22 '15 at 01:14
  • I think [this](http://stackoverflow.com/questions/5082126/how-do-i-do-web-config-transformations-with-visual-studio-website-projects) satisfies your question... let me know because I'm duty-bound to wield the [dupehammer](http://meta.stackexchange.com/questions/230865/increase-close-vote-weight-for-gold-tag-badge-holders/231212#231212) if it does. – spender Jan 22 '15 at 01:21
  • @spender No, you're not. –  Jan 22 '15 at 01:36
  • ...ah... it depends how you define duty, and to whom you feel you owe it to, no? – spender Jan 22 '15 at 01:43

0 Answers0