“Could not find a part of the path” error message

The error is self explanatory. The path you are trying to access is not present. I’m sure that this is not the correct path. Debug folder directly in E: drive looks wrong to me. I guess there must be the project name folder directory present. Second thing; what is {0} in your string. I am sure that it is an argument … Read more

Regex that accepts only numbers (0-9) and NO characters

Your regex ^[0-9] matches anything beginning with a digit, including strings like “1A”. To avoid a partial match, append a $ to the end: This accepts any number of digits, including none. To accept one or more digits, change the * to +. To accept exactly one digit, just remove the *. UPDATE: You mixed up the arguments to IsMatch. The pattern should be the second argument, … Read more

A generic error occurred in GDI+, JPEG Image to MemoryStream

OK I seem to have found the cause just by sheer luck and its nothing wrong with that particular method, it’s further back up the call stack. Earlier I resize the image and as part of that method I return the resized object as follows. I have inserted two calls to the above method and … Read more

Best way to generate a random float in C#

Best approach, no crazed values, distributed with respect to the representable intervals on the floating-point number line (removed “uniform” as with respect to a continuous number line it is decidedly non-uniform): (*) … check here for subnormal floats Warning: generates positive infinity as well! Choose exponent of 127 to be on the safe side. Another approach which will give … Read more

Metadata file ‘.dll’ could not be found

Written Instructions: Right click on the solution and click Properties. Click Configuration on the left. Make sure the check box under “Build” for the project it can’t find is checked. If it is already checked, uncheck, hit apply and check the boxes again. (Optional) You had to do it for both Release and Debug modes … Read more