Sharing images with multiple web sites

Discussion in 'ASP .Net' started by =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006.

  1. Since we are unable to use IIS on our developer workstations due to security
    policy, we would like to use the internal web server baked into VS.NET 2005.
    The problem that I am currently running into is that we have many web
    applications that share common images and I don't know where to put them. I'm
    not able to create a virtual directory in "Cassini", so that's not a viable
    solution. I also don't want to copy all the shared images under an \images
    directory under each web application as this will be an administrative and
    maintenance nightmare. We could store these images on a separate server and
    reference them via HTTP, but that won't be a nice solution from a deployment
    standpoint because we will need to change the code between development,
    staging and our production environments. If we use <%=location%> in the tags
    to find the location at runtime, then the images won't show up in the
    designer. I have searched the internet in vain for a solution, so hopefully
    you will have some guidance on this issue. I must be overlooking the obvious.
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006
    #1
    1. Advertising

  2. Use an absolute URL, such as
    http://yourdomain.com/yourimageweb/images/image.jpg

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Chicken Salad Alchemist

    Sequence, Selection, Iteration.


    "Jason Camp" <> wrote in message
    news:D...
    > Since we are unable to use IIS on our developer workstations due to
    > security
    > policy, we would like to use the internal web server baked into VS.NET
    > 2005.
    > The problem that I am currently running into is that we have many web
    > applications that share common images and I don't know where to put them.
    > I'm
    > not able to create a virtual directory in "Cassini", so that's not a
    > viable
    > solution. I also don't want to copy all the shared images under an \images
    > directory under each web application as this will be an administrative and
    > maintenance nightmare. We could store these images on a separate server
    > and
    > reference them via HTTP, but that won't be a nice solution from a
    > deployment
    > standpoint because we will need to change the code between development,
    > staging and our production environments. If we use <%=location%> in the
    > tags
    > to find the location at runtime, then the images won't show up in the
    > designer. I have searched the internet in vain for a solution, so
    > hopefully
    > you will have some guidance on this issue. I must be overlooking the
    > obvious.
     
    Kevin Spencer, Jul 26, 2006
    #2
    1. Advertising

  3. The absolute URL would change from development to staging to production, so I
    would then have to go and change all reference before deployment from one
    platform to another. I don't like this idea.

    "Kevin Spencer" wrote:

    > Use an absolute URL, such as
    > http://yourdomain.com/yourimageweb/images/image.jpg
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Professional Chicken Salad Alchemist
    >
    > Sequence, Selection, Iteration.
    >
    >
    > "Jason Camp" <> wrote in message
    > news:D...
    > > Since we are unable to use IIS on our developer workstations due to
    > > security
    > > policy, we would like to use the internal web server baked into VS.NET
    > > 2005.
    > > The problem that I am currently running into is that we have many web
    > > applications that share common images and I don't know where to put them.
    > > I'm
    > > not able to create a virtual directory in "Cassini", so that's not a
    > > viable
    > > solution. I also don't want to copy all the shared images under an \images
    > > directory under each web application as this will be an administrative and
    > > maintenance nightmare. We could store these images on a separate server
    > > and
    > > reference them via HTTP, but that won't be a nice solution from a
    > > deployment
    > > standpoint because we will need to change the code between development,
    > > staging and our production environments. If we use <%=location%> in the
    > > tags
    > > to find the location at runtime, then the images won't show up in the
    > > designer. I have searched the internet in vain for a solution, so
    > > hopefully
    > > you will have some guidance on this issue. I must be overlooking the
    > > obvious.

    >
    >
    >
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006
    #3
  4. =?Utf-8?B?SmFzb24gQ2FtcA==?=

    Patrice Guest

    My personal preference would be likely still just to automate the copy using
    a tool such as "robocopy" (downloable from MS, allows to synchronize
    directories) either on demand or at logon time depending on the update
    frequency (are they updated so often ?) or as part of the build process.

    The application could be also written to accomodate both scenarios (the
    location could be configurable, the application could redirect to an
    alternate location in dev mode).

    You could also try a Windows admin group (you have little know options such
    as hardlinks or mount points though I believe it wouldn't work on a network
    share).

    Good luck
    --
    Patrice

    "Jason Camp" <> a écrit dans le message
    de news: ...
    > Since we are unable to use IIS on our developer workstations due to
    > security
    > policy, we would like to use the internal web server baked into VS.NET
    > 2005.
    > The problem that I am currently running into is that we have many web
    > applications that share common images and I don't know where to put them.
    > I'm
    > not able to create a virtual directory in "Cassini", so that's not a
    > viable
    > solution. I also don't want to copy all the shared images under an \images
    > directory under each web application as this will be an administrative and
    > maintenance nightmare. We could store these images on a separate server
    > and
    > reference them via HTTP, but that won't be a nice solution from a
    > deployment
    > standpoint because we will need to change the code between development,
    > staging and our production environments. If we use <%=location%> in the
    > tags
    > to find the location at runtime, then the images won't show up in the
    > designer. I have searched the internet in vain for a solution, so
    > hopefully
    > you will have some guidance on this issue. I must be overlooking the
    > obvious.
     
    Patrice, Jul 26, 2006
    #4
  5. I would think this would get very messy because we have 40 web applications
    that utilize the same images. A virtual directory would be beautiful, but
    unfortunately you can't do that with the web server embedded in VS.NET 2005.
    Another problem would be one of source control. These web sites would be a
    mixture of source controlled and unbound files. I think this too would get
    very confusing.

    "Patrice" wrote:

    > My personal preference would be likely still just to automate the copy using
    > a tool such as "robocopy" (downloable from MS, allows to synchronize
    > directories) either on demand or at logon time depending on the update
    > frequency (are they updated so often ?) or as part of the build process.
    >
    > The application could be also written to accomodate both scenarios (the
    > location could be configurable, the application could redirect to an
    > alternate location in dev mode).
    >
    > You could also try a Windows admin group (you have little know options such
    > as hardlinks or mount points though I believe it wouldn't work on a network
    > share).
    >
    > Good luck
    > --
    > Patrice
    >
    > "Jason Camp" <> a écrit dans le message
    > de news: ...
    > > Since we are unable to use IIS on our developer workstations due to
    > > security
    > > policy, we would like to use the internal web server baked into VS.NET
    > > 2005.
    > > The problem that I am currently running into is that we have many web
    > > applications that share common images and I don't know where to put them.
    > > I'm
    > > not able to create a virtual directory in "Cassini", so that's not a
    > > viable
    > > solution. I also don't want to copy all the shared images under an \images
    > > directory under each web application as this will be an administrative and
    > > maintenance nightmare. We could store these images on a separate server
    > > and
    > > reference them via HTTP, but that won't be a nice solution from a
    > > deployment
    > > standpoint because we will need to change the code between development,
    > > staging and our production environments. If we use <%=location%> in the
    > > tags
    > > to find the location at runtime, then the images won't show up in the
    > > designer. I have searched the internet in vain for a solution, so
    > > hopefully
    > > you will have some guidance on this issue. I must be overlooking the
    > > obvious.

    >
    >
    >
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006
    #5
  6. Put a "baseImageUrl" appSettings key in the web.config.
    All your image urls would have this prepended. When you "move" the app,
    the setting can be changed in only one place.
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "Jason Camp" wrote:

    > Since we are unable to use IIS on our developer workstations due to security
    > policy, we would like to use the internal web server baked into VS.NET 2005.
    > The problem that I am currently running into is that we have many web
    > applications that share common images and I don't know where to put them. I'm
    > not able to create a virtual directory in "Cassini", so that's not a viable
    > solution. I also don't want to copy all the shared images under an \images
    > directory under each web application as this will be an administrative and
    > maintenance nightmare. We could store these images on a separate server and
    > reference them via HTTP, but that won't be a nice solution from a deployment
    > standpoint because we will need to change the code between development,
    > staging and our production environments. If we use <%=location%> in the tags
    > to find the location at runtime, then the images won't show up in the
    > designer. I have searched the internet in vain for a solution, so hopefully
    > you will have some guidance on this issue. I must be overlooking the obvious.
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jul 26, 2006
    #6
  7. Will this solution display the images at design time?

    "Peter Bromberg [C# MVP]" wrote:

    > Put a "baseImageUrl" appSettings key in the web.config.
    > All your image urls would have this prepended. When you "move" the app,
    > the setting can be changed in only one place.
    > Peter
    >
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "Jason Camp" wrote:
    >
    > > Since we are unable to use IIS on our developer workstations due to security
    > > policy, we would like to use the internal web server baked into VS.NET 2005.
    > > The problem that I am currently running into is that we have many web
    > > applications that share common images and I don't know where to put them. I'm
    > > not able to create a virtual directory in "Cassini", so that's not a viable
    > > solution. I also don't want to copy all the shared images under an \images
    > > directory under each web application as this will be an administrative and
    > > maintenance nightmare. We could store these images on a separate server and
    > > reference them via HTTP, but that won't be a nice solution from a deployment
    > > standpoint because we will need to change the code between development,
    > > staging and our production environments. If we use <%=location%> in the tags
    > > to find the location at runtime, then the images won't show up in the
    > > designer. I have searched the internet in vain for a solution, so hopefully
    > > you will have some guidance on this issue. I must be overlooking the obvious.
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006
    #7
  8. Yes, as long as your web.config at design time is pointing to the actual
    locations of the images.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Chicken Salad Alchemist

    Sequence, Selection, Iteration.


    "Jason Camp" <> wrote in message
    news:...
    > Will this solution display the images at design time?
    >
    > "Peter Bromberg [C# MVP]" wrote:
    >
    >> Put a "baseImageUrl" appSettings key in the web.config.
    >> All your image urls would have this prepended. When you "move" the app,
    >> the setting can be changed in only one place.
    >> Peter
    >>
    >> --
    >> Co-founder, Eggheadcafe.com developer portal:
    >> http://www.eggheadcafe.com
    >> UnBlog:
    >> http://petesbloggerama.blogspot.com
    >>
    >>
    >>
    >>
    >> "Jason Camp" wrote:
    >>
    >> > Since we are unable to use IIS on our developer workstations due to
    >> > security
    >> > policy, we would like to use the internal web server baked into VS.NET
    >> > 2005.
    >> > The problem that I am currently running into is that we have many web
    >> > applications that share common images and I don't know where to put
    >> > them. I'm
    >> > not able to create a virtual directory in "Cassini", so that's not a
    >> > viable
    >> > solution. I also don't want to copy all the shared images under an
    >> > \images
    >> > directory under each web application as this will be an administrative
    >> > and
    >> > maintenance nightmare. We could store these images on a separate server
    >> > and
    >> > reference them via HTTP, but that won't be a nice solution from a
    >> > deployment
    >> > standpoint because we will need to change the code between development,
    >> > staging and our production environments. If we use <%=location%> in the
    >> > tags
    >> > to find the location at runtime, then the images won't show up in the
    >> > designer. I have searched the internet in vain for a solution, so
    >> > hopefully
    >> > you will have some guidance on this issue. I must be overlooking the
    >> > obvious.
     
    Kevin Spencer, Jul 26, 2006
    #8
  9. Would you please give me a code snippit on this? If this works at design time
    I'm ready to roll.

    "Kevin Spencer" wrote:

    > Yes, as long as your web.config at design time is pointing to the actual
    > locations of the images.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Professional Chicken Salad Alchemist
    >
    > Sequence, Selection, Iteration.
    >
    >
    > "Jason Camp" <> wrote in message
    > news:...
    > > Will this solution display the images at design time?
    > >
    > > "Peter Bromberg [C# MVP]" wrote:
    > >
    > >> Put a "baseImageUrl" appSettings key in the web.config.
    > >> All your image urls would have this prepended. When you "move" the app,
    > >> the setting can be changed in only one place.
    > >> Peter
    > >>
    > >> --
    > >> Co-founder, Eggheadcafe.com developer portal:
    > >> http://www.eggheadcafe.com
    > >> UnBlog:
    > >> http://petesbloggerama.blogspot.com
    > >>
    > >>
    > >>
    > >>
    > >> "Jason Camp" wrote:
    > >>
    > >> > Since we are unable to use IIS on our developer workstations due to
    > >> > security
    > >> > policy, we would like to use the internal web server baked into VS.NET
    > >> > 2005.
    > >> > The problem that I am currently running into is that we have many web
    > >> > applications that share common images and I don't know where to put
    > >> > them. I'm
    > >> > not able to create a virtual directory in "Cassini", so that's not a
    > >> > viable
    > >> > solution. I also don't want to copy all the shared images under an
    > >> > \images
    > >> > directory under each web application as this will be an administrative
    > >> > and
    > >> > maintenance nightmare. We could store these images on a separate server
    > >> > and
    > >> > reference them via HTTP, but that won't be a nice solution from a
    > >> > deployment
    > >> > standpoint because we will need to change the code between development,
    > >> > staging and our production environments. If we use <%=location%> in the
    > >> > tags
    > >> > to find the location at runtime, then the images won't show up in the
    > >> > designer. I have searched the internet in vain for a solution, so
    > >> > hopefully
    > >> > you will have some guidance on this issue. I must be overlooking the
    > >> > obvious.

    >
    >
    >
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 26, 2006
    #9
  10. Hi Jason,

    Here's an example from an ASP.Net web application I have worked on:

    <add key="ImagePath" value="http://www.airtraveler.com/airtraveler"/>

    This is combined with the image file name in the app to create the URL of
    the images in the app.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    Professional Chicken Salad Alchemist

    Sequence, Selection, Iteration.


    "Jason Camp" <> wrote in message
    news:...
    > Would you please give me a code snippit on this? If this works at design
    > time
    > I'm ready to roll.
    >
    > "Kevin Spencer" wrote:
    >
    >> Yes, as long as your web.config at design time is pointing to the actual
    >> locations of the images.
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> Professional Chicken Salad Alchemist
    >>
    >> Sequence, Selection, Iteration.
    >>
    >>
    >> "Jason Camp" <> wrote in message
    >> news:...
    >> > Will this solution display the images at design time?
    >> >
    >> > "Peter Bromberg [C# MVP]" wrote:
    >> >
    >> >> Put a "baseImageUrl" appSettings key in the web.config.
    >> >> All your image urls would have this prepended. When you "move" the
    >> >> app,
    >> >> the setting can be changed in only one place.
    >> >> Peter
    >> >>
    >> >> --
    >> >> Co-founder, Eggheadcafe.com developer portal:
    >> >> http://www.eggheadcafe.com
    >> >> UnBlog:
    >> >> http://petesbloggerama.blogspot.com
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> "Jason Camp" wrote:
    >> >>
    >> >> > Since we are unable to use IIS on our developer workstations due to
    >> >> > security
    >> >> > policy, we would like to use the internal web server baked into
    >> >> > VS.NET
    >> >> > 2005.
    >> >> > The problem that I am currently running into is that we have many
    >> >> > web
    >> >> > applications that share common images and I don't know where to put
    >> >> > them. I'm
    >> >> > not able to create a virtual directory in "Cassini", so that's not a
    >> >> > viable
    >> >> > solution. I also don't want to copy all the shared images under an
    >> >> > \images
    >> >> > directory under each web application as this will be an
    >> >> > administrative
    >> >> > and
    >> >> > maintenance nightmare. We could store these images on a separate
    >> >> > server
    >> >> > and
    >> >> > reference them via HTTP, but that won't be a nice solution from a
    >> >> > deployment
    >> >> > standpoint because we will need to change the code between
    >> >> > development,
    >> >> > staging and our production environments. If we use <%=location%> in
    >> >> > the
    >> >> > tags
    >> >> > to find the location at runtime, then the images won't show up in
    >> >> > the
    >> >> > designer. I have searched the internet in vain for a solution, so
    >> >> > hopefully
    >> >> > you will have some guidance on this issue. I must be overlooking the
    >> >> > obvious.

    >>
    >>
    >>
     
    Kevin Spencer, Jul 27, 2006
    #10
  11. =?Utf-8?B?SmFzb24gQ2FtcA==?=

    Patrice Guest

    As you wish... It left you with the other option, i.e. just have the
    application get the files from a configurable location...

    --
    Patrice

    "Jason Camp" <> a écrit dans le message
    de news: ...
    >I would think this would get very messy because we have 40 web applications
    > that utilize the same images. A virtual directory would be beautiful, but
    > unfortunately you can't do that with the web server embedded in VS.NET
    > 2005.
    > Another problem would be one of source control. These web sites would be a
    > mixture of source controlled and unbound files. I think this too would get
    > very confusing.
    >
    > "Patrice" wrote:
    >
    >> My personal preference would be likely still just to automate the copy
    >> using
    >> a tool such as "robocopy" (downloable from MS, allows to synchronize
    >> directories) either on demand or at logon time depending on the update
    >> frequency (are they updated so often ?) or as part of the build process.
    >>
    >> The application could be also written to accomodate both scenarios (the
    >> location could be configurable, the application could redirect to an
    >> alternate location in dev mode).
    >>
    >> You could also try a Windows admin group (you have little know options
    >> such
    >> as hardlinks or mount points though I believe it wouldn't work on a
    >> network
    >> share).
    >>
    >> Good luck
    >> --
    >> Patrice
    >>
    >> "Jason Camp" <> a écrit dans le
    >> message
    >> de news: ...
    >> > Since we are unable to use IIS on our developer workstations due to
    >> > security
    >> > policy, we would like to use the internal web server baked into VS.NET
    >> > 2005.
    >> > The problem that I am currently running into is that we have many web
    >> > applications that share common images and I don't know where to put
    >> > them.
    >> > I'm
    >> > not able to create a virtual directory in "Cassini", so that's not a
    >> > viable
    >> > solution. I also don't want to copy all the shared images under an
    >> > \images
    >> > directory under each web application as this will be an administrative
    >> > and
    >> > maintenance nightmare. We could store these images on a separate server
    >> > and
    >> > reference them via HTTP, but that won't be a nice solution from a
    >> > deployment
    >> > standpoint because we will need to change the code between development,
    >> > staging and our production environments. If we use <%=location%> in the
    >> > tags
    >> > to find the location at runtime, then the images won't show up in the
    >> > designer. I have searched the internet in vain for a solution, so
    >> > hopefully
    >> > you will have some guidance on this issue. I must be overlooking the
    >> > obvious.

    >>
    >>
    >>
     
    Patrice, Jul 27, 2006
    #11
  12. I understand the web.config portion, just don't know how to code the aspx
    side so that the image will show up in the designer. At runtime (viewed in
    browser) the proposed solution will work, but it doesn't seem to work at
    design time.

    "Kevin Spencer" wrote:

    > Hi Jason,
    >
    > Here's an example from an ASP.Net web application I have worked on:
    >
    > <add key="ImagePath" value="http://www.airtraveler.com/airtraveler"/>
    >
    > This is combined with the image file name in the app to create the URL of
    > the images in the app.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > Professional Chicken Salad Alchemist
    >
    > Sequence, Selection, Iteration.
    >
    >
    > "Jason Camp" <> wrote in message
    > news:...
    > > Would you please give me a code snippit on this? If this works at design
    > > time
    > > I'm ready to roll.
    > >
    > > "Kevin Spencer" wrote:
    > >
    > >> Yes, as long as your web.config at design time is pointing to the actual
    > >> locations of the images.
    > >>
    > >> --
    > >> HTH,
    > >>
    > >> Kevin Spencer
    > >> Microsoft MVP
    > >> Professional Chicken Salad Alchemist
    > >>
    > >> Sequence, Selection, Iteration.
    > >>
    > >>
    > >> "Jason Camp" <> wrote in message
    > >> news:...
    > >> > Will this solution display the images at design time?
    > >> >
    > >> > "Peter Bromberg [C# MVP]" wrote:
    > >> >
    > >> >> Put a "baseImageUrl" appSettings key in the web.config.
    > >> >> All your image urls would have this prepended. When you "move" the
    > >> >> app,
    > >> >> the setting can be changed in only one place.
    > >> >> Peter
    > >> >>
    > >> >> --
    > >> >> Co-founder, Eggheadcafe.com developer portal:
    > >> >> http://www.eggheadcafe.com
    > >> >> UnBlog:
    > >> >> http://petesbloggerama.blogspot.com
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >> "Jason Camp" wrote:
    > >> >>
    > >> >> > Since we are unable to use IIS on our developer workstations due to
    > >> >> > security
    > >> >> > policy, we would like to use the internal web server baked into
    > >> >> > VS.NET
    > >> >> > 2005.
    > >> >> > The problem that I am currently running into is that we have many
    > >> >> > web
    > >> >> > applications that share common images and I don't know where to put
    > >> >> > them. I'm
    > >> >> > not able to create a virtual directory in "Cassini", so that's not a
    > >> >> > viable
    > >> >> > solution. I also don't want to copy all the shared images under an
    > >> >> > \images
    > >> >> > directory under each web application as this will be an
    > >> >> > administrative
    > >> >> > and
    > >> >> > maintenance nightmare. We could store these images on a separate
    > >> >> > server
    > >> >> > and
    > >> >> > reference them via HTTP, but that won't be a nice solution from a
    > >> >> > deployment
    > >> >> > standpoint because we will need to change the code between
    > >> >> > development,
    > >> >> > staging and our production environments. If we use <%=location%> in
    > >> >> > the
    > >> >> > tags
    > >> >> > to find the location at runtime, then the images won't show up in
    > >> >> > the
    > >> >> > designer. I have searched the internet in vain for a solution, so
    > >> >> > hopefully
    > >> >> > you will have some guidance on this issue. I must be overlooking the
    > >> >> > obvious.
    > >>
    > >>
    > >>

    >
    >
    >
     
    =?Utf-8?B?SmFzb24gQ2FtcA==?=, Jul 27, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QlBlYXJzb24=?=

    Multiple sites sharing single web.config file

    =?Utf-8?B?QlBlYXJzb24=?=, Feb 9, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,931
    Maxim Kazitov
    Feb 10, 2004
  2. Kevin Buchan
    Replies:
    1
    Views:
    477
    Eric Lawrence [MSFT]
    Feb 20, 2004
  3. Jasbird

    Sites about web-sites ?

    Jasbird, Sep 12, 2006, in forum: HTML
    Replies:
    1
    Views:
    400
  4. =?Utf-8?B?dGlu?=
    Replies:
    0
    Views:
    308
    =?Utf-8?B?dGlu?=
    Nov 14, 2006
  5. imx
    Replies:
    10
    Views:
    805
Loading...

Share This Page