Saturday, March 31, 2012

Sharing images with multiple web sites

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.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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:DCEC13E6-7A27-4852-A6A8-9CAC87F66E85@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


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:

Quote:

Originally Posted by

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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:DCEC13E6-7A27-4852-A6A8-9CAC87F66E85@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


>
>
>


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" <JasonCamp@dotnet.itags.org.discussions.microsoft.coma crit dans le message
de news: DCEC13E6-7A27-4852-A6A8-9CAC87F66E85@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


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:

Quote:

Originally Posted by

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" <JasonCamp@dotnet.itags.org.discussions.microsoft.coma écrit dans le message
de news: DCEC13E6-7A27-4852-A6A8-9CAC87F66E85@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


>
>
>


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:

Quote:

Originally Posted by

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.


Will this solution display the images at design time?

"Peter Bromberg [C# MVP]" wrote:

Quote:

Originally Posted by

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:
>

Quote:

Originally Posted by

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.


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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:11CE38AC-6636-4CEE-90AF-F00E0279A918@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

Will this solution display the images at design time?
>
"Peter Bromberg [C# MVP]" wrote:
>

Quote:

Originally Posted by

>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:
>>

Quote:

Originally Posted by

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.


Would you please give me a code snippit on this? If this works at design time
I'm ready to roll.

"Kevin Spencer" wrote:

Quote:

Originally Posted by

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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:11CE38AC-6636-4CEE-90AF-F00E0279A918@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

Will this solution display the images at design time?

"Peter Bromberg [C# MVP]" wrote:

Quote:

Originally Posted by

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.


>
>
>


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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:4255FE80-2457-4A80-A26B-C2E1F5797810@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

Would you please give me a code snippit on this? If this works at design
time
I'm ready to roll.
>
"Kevin Spencer" wrote:
>

Quote:

Originally Posted by

>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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
>news:11CE38AC-6636-4CEE-90AF-F00E0279A918@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


>>
>>
>>


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" <JasonCamp@dotnet.itags.org.discussions.microsoft.coma crit dans le message
de news: 3A71276D-8087-49F6-8E8E-DE482BF5E5E6@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

>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:
>

Quote:

Originally Posted by

>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" <JasonCamp@dotnet.itags.org.discussions.microsoft.coma crit dans le
>message
>de news: DCEC13E6-7A27-4852-A6A8-9CAC87F66E85@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

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.


>>
>>
>>


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:

Quote:

Originally Posted by

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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:4255FE80-2457-4A80-A26B-C2E1F5797810@dotnet.itags.org.microsoft.com...

Quote:

Originally Posted by

Would you please give me a code snippit on this? If this works at design
time
I'm ready to roll.

"Kevin Spencer" wrote:

Quote:

Originally Posted by

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" <JasonCamp@dotnet.itags.org.discussions.microsoft.comwrote in message
news:11CE38AC-6636-4CEE-90AF-F00E0279A918@dotnet.itags.org.microsoft.com...
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.
>
>
>


>
>
>

0 comments:

Post a Comment