Stephan Smetsers

hi,

I noticed that Sandcastle doesn't generate online msdn-links when the internet connection is through a proxy server.

--- copy from email to Eric Woodruff ---

I did some investigation on the ResolveReferenceLinksComponent2 component stored in the BuildComponents.dll assembly. I noticed that the MSDNResolver that was internally being used by this component uses a ContentService (which inherits from SoapHttpClientProtocol) that had no proxy support (although it supports a proxy, the proxy wasn't set)

The problem with the online MSDN links only occurred when I have my PC connected at a customers network that uses proxy settings to connect over the internet. At other networks (without any proxy settings) everything works out fine.


Kind regards,

Stephan Smetsers



Re: Developer Documentation and Help System No online MSDN links when using proxy server

Dave Sexton

Hi Stephan,

I haven't tried this myself, but using the defaultProxy element in MRefBuilder's .NET configuration file might work (not MRefBuilder.config, but a new file named, MRefBuilder.exe.config).

<defaultProxy> Element

http://msdn2.microsoft.com/en-us/library/kd3cf2ex.aspx

- Dave






Re: Developer Documentation and Help System No online MSDN links when using proxy server

Stephan Smetsers

thanks,... I will look into that..

Stephan





Re: Developer Documentation and Help System No online MSDN links when using proxy server

EWoodruff

You didn't mention it failing but the following is from the SHFB FAQ regarding the proxy server and BuildAssembler:

My build fails because I am behind a proxy server and it cannot connect to the MSDN web service. How do I fix it

If the SdkLinkType property is set to MSDN, BuildAssembler will attempt to contact the MSDN web service to resolve links to SDK topics. If you are behind a proxy server, this will most likely fail and will abort the build process with an error similar to "HTTP status 407: Proxy Authentication Required". The simplest fix is to set the SdkLinkType property to None. The downside is that you will not get links to online SDK content. It has been reported that creating a BuildAssembler.exe.config file in the same folder as BuildAssembler.exe (the .\ProductionTools folder under the Sandcastle installation folder) and putting one of the following in it may allow it to work with the proxy server:

Method 1 (this works most often so try it first):

<configuration>
  <system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy usesystemdefault="true"/>
    </defaultProxy>
  </system.net>
</configuration>

Method 2:

<configuration>
  <system.net>
   <defaultProxy enabled="true" useDefaultCredentials="true">
    <proxy bypassonlocal="True"
      proxyaddress="http://yourproxy:8080" />
   </defaultProxy>
  </system.net>
</configuration>

Method 3 (use this if your company uses a proxy configuration script):

<configuration>
  <system.net>
   <defaultProxy useDefaultCredentials="true">
    <proxy scriptLocation="http://your.server.com/proxy.pac"
      usesystemdefault="True" />
   </defaultProxy>
  </system.net>
</configuration>

Eric





Re: Developer Documentation and Help System No online MSDN links when using proxy server

Stephan Smetsers

thanks guys,

method 3 worked out fine!

Stephan





Re: Developer Documentation and Help System No online MSDN links when using proxy server

Dave Sexton

Oh right, BuildAssembler.exe.config, not MRefBuilder.exe.config. Thanks Eric.






Re: Developer Documentation and Help System No online MSDN links when using proxy server

Stephan Smetsers

It would be nice if this setting could be part of the sandcastle.config file instead of the MRefbuilder.exe.config file.

When you use Vista, you don't have accessrights to change that. If somehow this could be configurable than an userinterface could ask for the proxy settings and put it in the customized sandcastle.config file (at a writeable location)

Stephan





Re: Developer Documentation and Help System No online MSDN links when using proxy server

Dave Sexton

Hi Eric,

I'd like to put this info into the Sandcastle Help wiki, if that's okay with you (I'll give you credit, of course). Though I think I may create a separate topic and just add a link. Is that cool

- Dave






Re: Developer Documentation and Help System No online MSDN links when using proxy server

Dave Sexton

I agree with Stephan. If Build Assembler could support a configuration element in the sandcastle.config file that would be great. Something like this:

sandcastle.config

<configuration>

<proxy>

[same schema as the proxy section for the managed config file]

</proxy>
<dduetools>

...

- Dave






Re: Developer Documentation and Help System No online MSDN links when using proxy server

EWoodruff

Hi Dave,


Regarding putting the info on the help page, that would be fine.

Eric





Re: Developer Documentation and Help System No online MSDN links when using proxy server

Dave Sexton

Hi everyone,

Sandcastle and Proxy Servers

http://www.codeplex.com/DocProject/Wiki/View.aspx title=Sandcastle+and+Proxy+Servers

Thanks Eric.

- Dave