locked
Deploy main web.config RRS feed

  • Question

  • User1397428144 posted

    Hi,

    I try to deploy a new main web.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\CONFIG\web.config) for all site on the server with a 2005 deployment project. But it never overrides the existing files.

    I had the same problem with 2003 and machine.config. I add to create a .bat and execute it manualy after the deployment setup.

    Is where a way to do this better in 2005 ?

    I really need to modify a common web.config. My web.config is the original plus some additionnal stuffs shared for all sites.

     

    Tuesday, January 23, 2007 9:13 AM

All replies

  • User2093584515 posted

    VS 2005 really is awesome but it can behave oddly when you work with applications on remote.

    A good practice is to have another FTP client that can sync your web.config files.

    For that alone many of us use clients like Dreamweaver or CuteFTP.

    This is simply a suggestion of course but it does make file synchronization easier.

    Tuesday, January 23, 2007 10:34 AM
  • User1397428144 posted

    Hi,

    It has nothing to do with an FTP client. I deploy with an msi directly on the server.

    But the msi don't let you deploy the web.config the framework web.config

    Wednesday, January 24, 2007 3:22 AM
  • User555306248 posted
    In .NET Framework 2.0 (VS 2005) Each web.config which in that folder override the setting for their parent direcory
    Thursday, February 8, 2007 7:36 AM
  • User1397428144 posted

    Thanks but I know that.

    I want to deploy the main web.config : the one in the framework CONFIG directory. And I want to do it with a dotnet deployment setup

    Thursday, February 8, 2007 7:53 AM
  • User1347944086 posted

    You can force the web.config while deploying your web site, simply add a <Copy> within your <Target Name="AfterBuild">

    You do not need a .bat or any .msi

    Saturday, February 10, 2007 10:19 AM
  • User1397428144 posted
    your wolution is valid only if you compile and deploy on the same machine. I compile on a machine and I deploy on more than one machine not each time I compile.
    Monday, February 12, 2007 4:18 AM
  • User1347944086 posted

    AfterBuil was just an exemple. Use it as you want to use it...

    You can customize MSBuild as you want... For exemple you can create a new target "OverrideWebConfig", use properties to define target machines, or even read targets from an external file using ReadLinesFromFile. I've never use this myself but it should be another solution...

    Then you can execute your OverrideWebConfig when necessary or automatically with a new target dependency.

    Monday, February 12, 2007 4:32 AM
  • User1347944086 posted

    I try to deploy a new main web.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\CONFIG\web.config) for all site on the server with a 2005 deployment project. But it never overrides the existing files.
    your wolution is valid only if you compile and deploy on the same machine

    At first you wanted just to copy a file on the server. But you can copy files to many servers at the same time using MSBuild.

    Just an example :

     <ItemGroup>

    <MyFiles Include="*.test" />

    <MachineA Include=\\A\c$\ />

    <MachineB Include=\\B\c$\ />

    </ItemGroup>

    <Target Name="Copy2A">

    <Copy SourceFiles="@(MyFiles)" DestinationFolder="@(MachineA)" />

    </Target>

    <Target Name="Copy2B">

    <Copy SourceFiles="@(MyFiles)" DestinationFolder="@(MachineB)" />

    </Target>

    <Target Name="CopyEverywhere">

    <CallTarget Targets="Copy2A;Copy2B" />

    </Target>

    <ITEMGROUP><MYFILES Include="*.test"><MACHINEA Include="\\A\c$\"><MACHINEB Include="\\B\c$\"></ITEMGROUP><TARGET Name="Copy2A"><COPY DestinationFolder="@(MachineA)" SourceFiles="@(MyFiles)"></TARGET><TARGET Name="Copy2B"><COPY DestinationFolder="@(MachineB)" SourceFiles="@(MyFiles)"></TARGET><TARGET Name="CopyEverywhere"><CALLTARGET Targets="Copy2A;Copy2B"></TARGET>
    Monday, February 12, 2007 6:06 AM
  • User1397428144 posted

    Ok but it's not valid in my context.

    I need to generate a setup file of my framework.

    Then I distribute this setup file to developer.

    So I have to deploy my web.config with my application setup.

    Monday, February 12, 2007 10:33 AM
  • User1347944086 posted

    OK. So if you know you need a setup, deploy your web.config as a setup.

    Sorry, but I think I have not understand what your problem was... You were talking about WDP first. Good luck !

    I try to deploy a new main web.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\CONFIG\web.config) for all site on the server with a 2005 deployment project. But it never overrides the existing files.

    Monday, February 12, 2007 2:59 PM
  • User1397428144 posted
    I use a Web Deployment Project. But when you try to deploy the main web.config with it, it doesn't do it. It seems it's locked.
    Tuesday, February 13, 2007 3:03 AM