473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

FYI: Strange VS Behaviour with SSL Solution - But Why?


Dear Group

I came accross a very annoying behaviour of Visual Studio, giving me
six hours of headache till I found the solution.

This post is mainly for fellow developers for reference as it took me
ages reading through tons of posts till I found an answer. However, I'm
also interested why Visual Studio behaves that way. If anyone has a
theorie on it please let me know.

Background:
I want to run a web application over SSL and installed a thwarte trial
certificate on my local development machine in IIS 5. It all worked
fine until I introduced the following code in my login page's page_load
event:

....
LoadConfig()

'Determine Connection Type
If System.Web.HttpContext.Current.Request.IsSecureCon nection = False
Then
'Redirect To Use SSL

System.Web.HttpContext.Current.Response.Redirect(C Str(Session("URLRootSecure"))
+ "login.aspx")
End If

....

The session variable URLRootSecure is simply a value from an outside
configuration text file which is loaded with a bunch of other
configuration vales into session variables in the LoadConfig() routine.
It reads: "https://localhost/myapp/"

When debugging the application in Visual Studio all worked fine. It
recognised a standard connection and redirected to a secure connection.
However, the nightmare started to unfold once I had closed the project.
When I wanted to open it again in Visual Studio I got the following
error:

'The web server reported the following error when attempting to create
or openthe Web project located at the following URL:' ...
'The host name in the certificate is invalid or does not match'.

That seemed strange as the application worked still fine when accessing
it in my browser with https:/localhost/myapp/login.aspx and I knew that
it wasn't a fault with the certificate. Anyways, I went ahead and
removed the certificate. Just to receive the following error when
trying to open the project in Visual Studio again:

'The web server reported the following error when attempting to create
or openthe Web project located at the following URL:' ...
'A connection with the server could not be established'.

Again, that seemed weird as I had no problem opening other projects or
to create a new web project and IIS was running. Several desperate
attempts followed to get my project to open again, just naming a few:
Ran aspnet_regiis.exe just in case, created and installed a new
VeriSign trial certificate both without luck. Then I created a new web
application and imported all forms and code into it. That seemed to be
fine UNTIL I again closed Visual Studio. The same error occured when
opening the project!

After much frustration I found a post suggesting to delete my project
DLL in the build folder. Once deleted, voila, I could open the project
without any error! Once recompiled and closed, it all started again.

So I went ahead, repeated the process, commented the line in my
page_load where it redirects to https:, built the solution, closed and
were able to open it without complaints! So now I know to uncomment
that line in the production environment but not to touch it in
development. Just as a side note, changing the URLRootSecure value in
my text file to http:// etc throw the error:

'The web server reported the following error when attempting to create
or openthe Web project located at the following URL:' ...
'The HTTP redirect request failed.'

This raises several questions:

- Why on earth does Visual Studio .NET 2003 do such a thing? It's weird
that it not only seems to validate code but go so far to loading values
from a text file into session variables and then to run a line of code
just when I want to OPEN a web project! I thought that's a runtime
thing when I actually debug the application.
I mean it let's me save syntax errors and doesn't care about them when
opening a project!

- Why does it validate at all as it doesn't seem to care in case the
project DLL is missing. Very contradictive. It should throw an error in
this case too. But of course not, as a project DLL isn't always
present.

- And why does it let me debug the application and doesn't complain
there and then, but throws cryptic errors when I want to open the
project again?

- Why do I get 'The HTTP redirect request failed.' for this line of
code but not for any other response. redirect's I have in my code?

At the moment all I can think of that this is total irrational
behaviour and bs. If you have another view, please let me know.

Thanks for your time and efforts!

Martin

Nov 19 '05 #1
0 1402

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Torsten Reiners | last post by:
Hi, it might be a simple solution but I do not see it. The problem is that I have the following file stored on my local harddrive. All references are URL to a remote computer. It is working,...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
3
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP...
31
by: gamehack | last post by:
Hi all, I've been testing out a small function and surprisingly it does not work okay. Here's the full code listing: #include "stdlib.h" #include "stdio.h" char* escaped_byte_cstr_ref(char...
2
by: flits | last post by:
LS I have set up my first Linux box. But I experience some strange POST behaviour. Maybe this is a know bug or maybe I have done something wrong with my setup. But I just can't seem to find any...
8
by: matthewperpick | last post by:
Check out this toy example that demonstrates some "strange" behaviour with keyword arguments and inheritance. ================================= class Parent: def __init__(self, ary = ):...
4
prometheuzz
by: prometheuzz | last post by:
Hello all, There's this problem I have, which I am unable to find a solution for. The problem is this: I cannot post messages with a specific size on (certain) forums. I hear you thinking: what...
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.