Solving: HttpContext.Current.User.Identity.Name is empty, when using Windows Authentication.

If you want to use Windows Authentication in your ASP .NET website, you need to add the <authentication mode="Windows"/> tag in the Web.config. <system.web> <authentication mode="Windows"/> If the HttpContext.Current.user.Identity.Name is still empty. Check the authentication feature of the web application in IIS, make sure all authentication mechanisms are Disabled, except …

Transforming an input file to an output file in C#, by using XSLT.

Just a code snippet for transforming an input file to an output file in C# by using XSLT: /// <summary> /// Transform an input file to an output file, by using XSLT. /// </summary> public void ExecuteTransform() { string xsltFilePath = @"C:\BDATA\Transform.xsl"; string sourceFilePath = @"C:\BDATA\input.xml"; string destinationFilePath = @"C:\BDATA\output.xml"; …

How to: Adjust C# assembly probing path at runtime.

When a assembly is not found, when using the standard probing method, an assembly resolve event is fired, allowing to load the assembly from a different file system path:   public void Test() { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(LoadFromSameFolder); } public static Assembly LoadFromSameFolder(object sender, ResolveEventArgs args) …