Hi,
I have this same issue "No connection could be made because the target machine actively refused it"...
from this posting here http://stackoverflow.com/questions/2972600/no-connection-could-be-made-because-the-target-machine-actively-refused-it
it suggests some retry logic on the client code, but I am not sure where and how to insert the retry logic for my attached code.
I would appreciate some help from the experts.
Code as attached.
thanks.
Loading
TAN WhoAMIPosted Jun 24, 2013, 8:00 PM
Amit ChoudharyPosted Jun 24, 2013, 10:47 AM
TAN WhoAMIPosted Jun 23, 2013, 11:56 PM
Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
I try the solution from http://www.nivisec.com/2009/06/could-not-load-file-or-assembly.html
but it does not help.
I have installed MS Silverlight 2.0 with C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\System.Core.dll
but its version is 2.0.30523.6
when I >gacutil /l System.Core, I have this:
Amit ChoudharyPosted Jun 18, 2013, 2:01 PM
TAN WhoAMIPosted Jun 16, 2013, 10:12 PM
Appreciate your response... however, I am not able to install Palmer Library on my Visual Studio 2010, with .NET Framework 4.0... I am still contact the author of Palmer Library...
Error as below and attached:
Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.
Package Manager Console Host Version 2.0.30625.9003
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package Palmer
Successfully installed 'Palmer 0.1.4724.20297'.
Successfully uninstalled 'Palmer 0.1.4724.20297'.
Install failed. Rolling back...
Install-Package : Could not install package 'Palmer 0.1.4724.20297'. You are trying to install this package into a project that targets '
.NETFramework,Version=v4.0', but the package does not contain any assembly references that are compatible with that framework. For more i
nformation, contact the package author.
At line:1 char:16
+ Install-Package <<<< Palmer
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Install-Package : Could no
t install package 'Palmer 0.1.4724.20297'. You are trying to install this package into a project that targets '
.NETFramework,Version=v4.0', but the package does not contain any assembly references that are compatible with that framework. For more i
nformation, contact the package author.
At line:1 char:16
+ Install-Package <<<< Palmer
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Amit ChoudharyPosted Jun 13, 2013, 1:27 PM
For e.g. on your exception you may want to try again for a no. of time and then throw the exception.
Let say you want to repeat the webrequest, first you should refactor your code to get a common function for webrequest. So everytime you call your method to download it gets repeated everywhere in your application if required.
you can use Palmer library for adding retry block in your code.
sample for retrying the on exception for 5 times:
Retry.On<WebException>().For(5).With(context =>
{
// Code that might throw a web exception. for e.g. your webRequest
});