.Net & C#

C# WebClient return an error (401) Unauthorized. Easy fix

My code in C# console application used to download an image from web service and store it in SharePoint library. But some why the code always returned an error “(401) Unauthorized”. The requested URL has been successfully opened in browser on the same machine. Read more»

.Net & C#

How to generate and save Connection string in Visual Studio

Figure 3. connectionStrings in web.config

Writing connection string manually is one of the worst things in software development. That’s why I always want them to be generated by any tool but not by me. Some times before I have found a way how to generate a connection string creating an .udl file in Windows (http://markimarta.com/c/how-easily-write-the-text-of-connection-string/). Now I’ve found a better […] Read more»

.Net & C#

Create a load test in Visual Studio 2013

Figure 5. Test mix model

Load test allow to understand how many users at once your server and application can process at once. Visual studio 2013 allows you to imitate user action and as robots, so and with human-like behavior. Read more»

.Net & C#

Create web test in Visual studio 2013

Figure 3. Finishing web test recording

My post yesterday was about how to get to results of load test. Now I realized that I still hadn’t posted about how to create web test and load test in Visual Studio 2013. In Visual Studio 2013 Professional it’s rather easy to do – you don’t need to install add-ons or plugins, everything is […] Read more»

.Net & C#

How to fix warning “System.Configuraion.ConfigurationSettings.AppSettings” is obsolete in Visual Studio

Figure 2. Adding reference "System.Configuration"

Usage “Application configuration file” is very good in creating simple applications. It’s very good to store in it values like path, string for database connection or something like this. I use it for a long time. But not so long ago I have noticed that Studio highlights string where configuration file used: Read more»

.Net & C#

C# write file to MyDocuments

Using class System.Environment you can get paths of special Windows folders such as Program Files, My Documents and others. The list of available values is stored in enum object Environment.SpecialFolder (Fugure 1). Read more»

.Net & C#

Fix error “System.InvalidCastException [A]Microsoft.Expression.Utility.Controls.ClearableSearchTextBox cannot be cast to [B]Microsoft.Expression.Utility.Controls.ClearableSearchTextBox”

[A]Microsoft.Expression.Utility.Controls.ClearableSearchTextBox cannot be cast to [B]Microsoft.Expression.Utility.Controls.ClearableSearchTextBox

As a result of experiments with WPF controls I got the error in Visual Studio 2013. I started to look for records in block “using”, but it was all right there. Read more»

.Net & C#

How to create .Ashx solution for SharePoint 2010 in Visual Studio 2010

Figure 1. Add Generic handler via Application page template

Generic handlers have an extension .ASHX. It’s a good solution to render documents or images for user on server-side after user requests, not web page. Generic Handlers solution (.ashx files) are not directly supported by Visual Studio 2010 for SharePoint projects. But there’s a little trick for this. Read more»

.Net & C#

Popular Posts