c#,azure,imageresizerRelated issues-Collection of common programming errors


  • Afnan Bashir
    c# proxy
    Is it possible to detect which proxy is active which is dead? using c# and a combo box containing list of proxies with port number is there any way we take every proxy one by one and determine as if it was dead or active?Microsoft.Win32.RegistryKey registry = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(“Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings”, true);registry.SetValue(“ProxyEnable”, 1);registry.SetValue(“ProxyServer”, comboBox1.Text);

  • Ian Nelson
    c# asp.net winforms using-statement
    I’m trying to use the System.Drawing.Color namespace. I’m not able to define it at the top of the class:However, I can reference it within the class. That is, I can use this line of code, and it works:txtBox.BackColor = System.Drawing.Color.LightPink;… but I’d rather just be able to do this:txtBox.BackColor = Color.LightPink;If it’s a matter of a missing reference/dll, why am I able to make reference to System.Drawing.Color in my code?

  • Misha Zaslavsky
    c# null
    I was on the IBM page looking for some filenet example code for .NET and I found this:namespace CESample {// Represents the connection with the Content Engine.public class CEConnection{private IDomain domain;private IObjectStoreSet ost;private ArrayList osNames;private String domainName;private bool isCredentialsEstablished;// Constructorpublic CEConnection(){domain = null;ost = null;osNames = new ArrayList();domainName = null;isCredentialsEstablished = false;}//… other methodsIts this alright

  • John Saunders
    c# .net dynamic .net-4.0 generic-type-argument
    I suspect the short answer to this question is “no” but I’m interested in the ability to detect the use of the dynamic keyword at runtime in C# 4.0, specifically as a generic type parameter for a method.To give some background, we have a RestClient class in a library shared among a number of our projects which takes a type parameter to specify a type that should be used when de-serializing the response, e.g.:public IRestResponse<TResource> Get<TResource>(Uri uri, IDictionary<strin

  • Mark Canlas
    c# sql linq linq-to-sql
    This is an in-depth continuation of my question from earlier this morning, which I’m still stumped about. I’m using a strongly typed DataContext for my application and although it emits a warning, it magically works. How does it do this?Here’s the code one would typically use to connect to a database using LINQ-to-SQL.class MyDatabase : DataContext {public Table<Widget> Widgets;public Table<Car> Cars;public MyDatabase (string connection) : base(connection) { } }Even though it emits

  • Ben Voigt

  • skaffman
    c# datetime
    For our support software in C#, I need to determine the time span between two DateTimes, but I only want opening hours counted (i.e. weekdays from 09:00 to 17:00).So, for instance, if the first DateTime is 15/02/2011 16:00 and the second is 16/02/2011 10:00, the method shall return 2 hours.Any help is greatly appreciated!

  • QmunkE
    c# web-services exception-handling webmethod
    I have a set of web services generated using the [WebMethod] attribute. Is it considered “good practice” to throw ArgumentException from such a method if its arguments aren’t properly specified (and no sensible defaults could be used)? If so, should this exception be caught and re-thrown in order to log it both on the server and the client?

  • Simon
    c# winforms repaint
    I’ve come across a problem that I’m hoping one of you fine thinkers can overcome…For some reason, once I have loaded up my Windows Form, if the user presses the ALT key, the form redraws causing a flash.This only happens the first time, so any subsequent presses of the ALT key do nothing.I don’t have any menu strips or events that handle the key press, so I can only assume it’s either a setting I haven’t set, or one that I have unknowingly set.FYI, the form does the following in the constructo

  • Brian Rasmussen
    c# constructor dependency-injection
    I’ve long considered it a bad practice to call out to a classes dependencies from within the constructor but wasn’t able to articulate why to a colleague yesterday. Can anyone provide a good reason for NOT doing this?

  • developer82
    c# visual-studio-2012 azure nuget-package
    I’m trying to add a nuget package to my project using the nuget package manager (right click and choosing “Manage Nugets”).I found the Windows Azure Service Bus and i’m clicking install. Then I get the following error:Attempting to resolve dependency ‘Microsoft.WindowsAzure.ConfigurationManager (? 2.0.2)’. Successfully installed ‘WindowsAzure.ServiceBus 2.2.1.1’. Unexpected end of file while parsing Comment has occurred. Line 46, position 17. Successfully uninstalled ‘WindowsAzure.ServiceBus 2.2

  • Oded
    xml azure escaping
    I am about to deploy my service on Windows Azure when I get this error:Error: The provided configuration file contains XML that could not be parsed. ‘$’ is an unexpected token. The expected token is ‘;’. Line 14, position 99.I have the following value inside my ServiceConfiguration.cscfg file <Setting name=”AUTH_KEY” value=”6v2^mG+$VN`P_9e9KVWkn)}8 Vtdqj?kB7l&kgVcR8i[P/h1dWp9q!(0~ eZ[xTk” />Is there a way to escape the whole string? Alternatively can I just escape the culprit “$”?

  • Ramie
    azure high-availability
    After trying to implement High Availability to one of the existing servers following this article https://www.windowsazure.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/After I was done the newly created machine is running, however I cannot RDP or PING any of the services that are running on the server existing. It shows that the VM is runningHas anyone faced such a problem before ?

  • Andrew Harry
    azure amazon-ec2 azure-web-roles restart azure-vm-role
    I am currently using Azure PaaS worker/web roles and I am hitting an annoying issue where if my database role is working really hard (100% CPU) it gets automatically restarted by the Azure App Fabric controller. This is getting really frustrating.My options are to over provision the role and pay more to stop the restarts. OR seek a alternative service provider which doesn’t do auto / heartbeat / restarts.Are the IaaS VM instances also subject to a Heartbeat health check? What about Amazon’s EC2

  • Aniket Sharma
    azure monodroid xamarin azure-mobile-services
    I was trying to use “InvokeApiAsync” methohd of Xamarin Azure Mobile Services Component 1.1.0 as mentioned below : var result = await _nativeClient.InvokeApiAsync (“insertsample”, HttpMethod.Post, null);I get an exception saying :{Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: O. Path ”, line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue () [0x00000] in <filename unknown>:0 at Newtonsoft.Json.JsonTextReader.ReadInte

  • Doug Dodge
    sql azure asp-classic
    I’ve inherited a classic ASP app and migrated to Windows Azure, SQL and all things work OK -except- one odd issue maybe you’d know about?ScenarioSelect rows of data order by matching unique ID – present to user interface. Two rows per ‘set’. One already marked in field ‘MasterSelect’ with a ‘Y’. ASP code called via radio button OnClick clears (or should) both fields in both records, then sets the new record’s field to have a ‘Y’ whether it’s the top or bottom selection. A toggle if you will.Work

  • user1316570
    c azure blob local hidden
    AzureXplorer – local blob storage – unexpected hidden fies when manually creating foldersOur C# ListBlobs method that works OK up in Azure revealed one extra file per folder locally named “$$$.$$$” that are not visible in AzureXplorer or ClumsyLeaf. Neither Google nor MSDN has turned up any note of this so I was wondering if any one else has seen this. The workaround for this defect in AzureXplorer is to manually create local blob folders with ClumsyLeaf which does NOT produce these hidden fil

  • Callum Hibbert
    azure
    What ever command I run from the Windows Azure PowerShell module, I get the same error. Example:Get-AzureStorageAccount : ‘Content-Type’ is an unexpected token. The expected token is ‘”‘ or ”’. Line 2, position 18. At line:1 char:24 + Get-AzureStorageAccount <<<< -StorageAccountName “bzyeastussys”+ CategoryInfo : CloseError: (:) [Get-AzureStorageAccount], XmlException+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.GetAzureStora

  • sharptooth
    azure reliability azure-worker-roles
    I want to create a web service hosted in Windows Azure. The clients will upload files for processing, the cloud will process those files, produce resulting files, the client will download them.I guess I’ll use web roles for handling HTTP requests and worker roles for actual processing and something like Azure Queue or Azure Table Storage for tracking requests. Let’s pretend it’ll be Azure Table Storage – one “request” record per user uploaded file.A major design problem is processing a single fi

  • Eduardo Z Lorenzo Jr
    c# azure
    Am getting “unexpected response code for operation : 1” from an app trying to insert records in an Azure table storage.Am basically placing the data in a TableOperation and already batching the inserts by 100 row chunks.Can’t really find much on the web about the specific “1” code in this Azure error message.Thanks all in advance!

  • Tristan
    imageresizer
    The documentation for ResizeSettings says: “Replaced by the Instructions class” http://documentation.imageresizing.net/docu/ImageResizer/ResizeSettings.htmThe documentation for Instructions says: “The successor to ResizeSettings.” http://documentation.imageresizing.net/docu/ImageResizer/Instructions.htmHowever, I cannot figure out how to use Instructions instead of ResizeSettings. I’ve triedGoogle Documentation (documentation.imageresizing.net) Looking through the Object Browser for uses of In

  • Ryan
    c# azure imageresizer
    I have an ASP.NET MVC 5 application and I’ve upgraded to the latest SDK 2.1.0.3 and it seems as though ImageResizer has blown up. Are there any work arounds? Here is the details:=== Pre-bind state information === LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35(Fully-specified) LOG: Appbase = xxx LOG: Initial PrivatePath = xxx Calling assembly : ImageResizer.Plugins.AzureReader2, Version=3.4.0.763, Culture=neutral, PublicKeyToke

  • brainbolt
    asp.net imageresizer
    This line is throwing the error: ImageBuilder.Current.Build(imgURL, imgURL, resizeImg);Any idea why?public void setImgSize(string controlId, string filename) {decimal currentWidth = 0;decimal currentHeight = 0;int maxFileWidth = 600;int maxFileHeight = 600;bool imageExists = false;string imgURL = “~/SODocs/” + SONum + “/” + filename;string imgPath = Server.MapPath(imgURL);if (File.Exists(imgPath)){imageExists = true;System.Drawing.Image imgFile = System.Drawing.Image.FromFile(imgPath);Image imgC

  • higgsy
    imageresizer
    Im using the awesome ImageResizing component and am experiencing an “Out of memory” error when trying to upload and read images that are about 100MB in size. It may seem large, but we’re a printers so many people do need to provide images of that size.The line of code that fails is:ImageResizer.ImageBuilder.Current.Build(Server.MapPath(strImagePath), Server.MapPath(strThumbPath), new ResizeSettings(“maxheight=” + “150”+ “&maxwidth=” + “238”));This is probably the GDI itself failing, but is t

  • Soner Gönül
    c# iis-7 imageresizer
    We had ImageResizer through the below error and subsequently I believe the app pool crashed and a new one started… This, in turn, also caused a massive queue of images to build up and the service was down for half an hour. Anyone seen this before?Note, we’ve also seen a few “access denied” errors from ImageResizer in the EventLog for images with “images” in their filename. Unsure if related.Any thoughts would be much appreciatedException information: Exception type: ImageProcessingException Ex

  • Rico
    c# asp.net-mvc amazon-s3 imageresizer
    i’ve finally gotten around to updating my mvc app to (Mvc 5, EF 6, Web Api 2 etc.) and now the only thing not working is the latest version of AWS SDK + Imageresizer as you can see here’s the error message i’m getting below *I have uninstalled the AWS package, then the Imageresizer package. Flipped them around as far as installation but still get the same issue.Obviously, when I don’t have the S3 plugin loaded it work so anymore things I should try here?Method not found: ‘Void Amazon.S3.Amazo

  • adaptive
    mono imageresizer
    I get the following error when using the ImageResizer module on Mono in Linux:Server Error in ‘/’ ApplicationArgument is out of range. Parameter name: dateDescription: HTTP 500. Error processing request.Stack Trace:System.ArgumentOutOfRangeException: Argument is out of range. Parameter name: dateat System.Web.HttpCachePolicy.SetLastModified (DateTime date) [0x00046] in /build/src/mono-2.10.8/mcs/class/System.Web/System.Web/HttpCachePolicy.cs:225 at ImageResizer.Caching.ResponseHeaders.DefaultApp

Web site is in building