Need to build my exe w/ VS .NET 2005?

Topics: Developer Forum
Feb 25, 2008 at 4:39 PM
I developed my app using Visual Studio .NET V2003 version 7.1 and its service pac, making use of FlickerNet. When I run, I get this error:

Authentication Problem: System.Net.WebException : The operation has timed-out.
at System.Net.HttpWebRequest.GetRequestStream()
at FlickerNet.Flickr.DoGetResponse(String url, String variables)
at FlickerNet.Flickr.GetResonse(Hashtable parameters, TimeSpan cacheTimeout)
at FlickerNet.Flickr.GetReponseNoCache(Hashtable parameters)
at FlickerNet.Flickr.AuthGetFrob()

I installed Visual Studio .NET V2005 version 8 and its service pac, converted my project file, built and the app runs w/o a problem. I would prefer to compile with 2003. Is there anything I can do to allow that to happen?
Coordinator
Feb 25, 2008 at 8:54 PM
This is the same issue here: http://www.codeplex.com/FlickrNet/Thread/View.aspx?ThreadId=22500

Unfortunately I don't get the same error even though I am using VS 2003 myself (I also test sometimes in VS 2005 and even VS 2008).

Can you comment out the following code:

if( variables.Length < 2000 )
{
	url += "?" + variables;
	variables = "";
}

and see if that makes any difference?
Feb 26, 2008 at 1:40 PM
I downloaded the code (As an aside...this is code that's more current than the what was released in V 2.1.5, right?). Made the changes you suggested and still get the same time-out error. Not sure if this is pertinent, but when I stepped through the code:

req.Method was set to "POST"
Proxy was null so req.Proxy was unchanged.
req.Timeout was set to 30000
req.UserAgent was set to "Mozilla/4.0 FlickrNet API (compatible; MSIE 6.0; Windows NT 5.1)"
req.KeepAlive was set to false
req._ExpectContinue is true

I'm running this inside the firewall where I work...not sure if that has an bearing on this. (As you've probably gleaned...I'm not very educated in the area of accessing web servers programmatically!).

Thanks for your help!
Coordinator
Feb 26, 2008 at 2:29 PM
Well if you are behind a firewall you will most likely need to set the Proxy to something. Does IE require a proxy? If so set Flickr.Proxy to the same details.

.Net 2.0 has different code which I believe automatically picks up the default IE proxy.
Feb 26, 2008 at 3:42 PM
If I look at the Tools->Options->Connections Tab->LAN Settings.. of IE I see that it's got "Use automatic configuration script" checked and sets "address" to http://proxy.kodak.com:81/proxy.pac (as opposed to having "Use a proxy server for your LAN" checked). So, yup, looks like I need to set the Proxy....now, how to do that and what to set it to??

In the Flickr() ctor it returns if "settings" isn't defined. Would you want to set Proxy to WebProxy.GetDefaultProxy() before returning in that case (like the code does when "settings" is non-null but settings.IsProxyDefined is null)? I'm aslo confused as to why the other ctor's don't do the same work in the default ctor of setting up the Proxy. I happenned to have been using the default ctor from my code, so it's a mute point for me.

As far as "how" to set the proxy:
In the Flickr() ctor, it looks like if I can figure out how to get a configuration settings setup correctly for "flickerNet" I can put the ProxyIPAddress, ProxyUserName and ProxyDomain in it and I should be good to go. Otherwise, I can instantiate my own WebProxy object and set Flickr's Proxy property. Right?

As far as "what to set the proxy to:
I'll run the code w/ a VS2005 exe and peek at what the proxy's IP address, username, and domain are in order to figure out what values I should use.

I'll let you know how it all pans out! Thanks a ton.
Coordinator
Feb 27, 2008 at 11:31 AM
Hopefully just adding the following should work then:

f.Proxy = WebProxy.GetDefaultProxy();

Feb 27, 2008 at 1:37 PM
The call to GetDefaultProxy returned a Proxy that had pretty much everything null'd out and I didn't see it reference the automated script file that needs to run. So, it still failed. At this point, for other reasons, I'm going to move forward and just use VS 2005 and not spend anymore time trying to get this to work w/ VS 2003. Thanks very much for your quick and helpful responses.