Debugging a WCF service on Windows 7 and IIS 7
I created and deployed a WCF service, created with Microsoft Visual Studio 2008, to IIS 7 on Windows 7 and I got the error message: Unable to start debugging on the web server. Could not
I created and deployed a WCF service, created with Microsoft Visual Studio 2008, to IIS 7 on Windows 7 and I got the error message: Unable to start debugging on the web server. Could not
If you want to show all encodings of a Windows server in C# in sorted order, use the code: // Get all encodings know on this server EncodingInfo[] encodings = Encoding.GetEncodings(); // Sort EncodingInfo array
You should use the function System.Security.SecurityElement.Escape and not the function System.Web.HttpUtility.HtmlEncode to escape special characters in XML if you don’t want the characters like éûÉ to be converted to éûÉ which is permit able but
If you want to create a customeventlog during setup, in a custom action. You can open a App.config file containing the log4net configuration and read the settings from that file at runtime. You also can
If you use the XmlConfigurator.Configure() . log4net function in a setup custom action to initialize the log4net logging, you can get the error: Could not load file or assembly ‘log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821’ or one
If you want to start the debugger after installation of you’re product with a Microsoft Visual Studio 2008 setup msi package, use a Installer class and custom actions and then add a Debugger.Break() on the
If you want to convert a string containing XML to a XDocument object, use: var document = XDocument.Parse(@"<?xml version=""1.0""?><root></root>"); For converting XmlDocument to XDocument and vice versa, see: http://blogs.msdn.com/marcelolr/archive/2009/03/13/fast-way-to-convert-xmldocument-into-xdocument.aspx
To convert a unicode string to an ASCII string, use: public void ConvertUnicodeStringToAsciiString() { // Create two different encodings. Encoding ascii = Encoding.ASCII; Encoding unicode = Encoding.Unicode; // Convert the string into a byte[]. byte[]
If you want to export images from a SQL Server database you could use the following code: public void ExportImagesFromDatabase() { var exportPath = @"C:\Temp"; if (!Directory.Exists(exportPath)) { Directory.CreateDirectory(exportPath); } var imagesTable = GetImagesFromDatabase("select [ImageColumn]
If you want to get the page filename from the current request url in ASP .NET you can use: string page = Path.GetFileName(Request.Url.LocalPath).ToLower(); This can be used to switch logica in de master page.