- CTRL+W, S: Solution Explorer
- CTRL+W, E: Error list
- CTRL+W, R: Resourceview
- CTRL+W, A: Command window
- CTRL+W, T: Taskview
- CTRL+W, Q: Find Symbol Results
- CTRL+W, X: ToolboX
- CTRL+W, C: Classview
Tuesday, June 25, 2013
Monday, June 03, 2013
This works for any serializable type or list of serializable type and deserialize back.
To Deseralize xml back to type T.
DataContractSerializer ser = new DataContractSerializer(typeof(T));
return (T)ser.ReadObject(xmlDocument.CreateReader(), true);
you need to refer using System.Xml.Serialization; in your class type.
Wednesday, April 24, 2013
I created a console application which was dependent of an xml file, I set the property of file to always copy and I always for new version of xml file inside execution directory and my console application worked until one day I wrapped that console application into windows service to run it periodically. And then this problem started.
When I run it in debug mode or console app mode it worked. I can to know about this error when I put a logging statement to log the error in eventviewer and then I found that Windows service code was looking for this file under system folder, here is error message I got in log “Could not find file 'C:\Windows\system32\ticks.xml'.”
Actually windows service runs from within system folder and their current directory (Environment.CurrentDirectory) is set to system directory and hence any relative lookup is based on this path.
To fix this problem, build your file path using AppDomain.CurrentDomain.BaseDirectory and relative path.
Monday, April 01, 2013
bool isEmptyNode = reader.IsEmptyElement;
WriteAttributes(writer, reader, country, culture);
Make sure that you read this property on Xml Node not of node attributes, to ensure this
1. Either read it in the beginning as I did or
2. Revert to Node using MoveToElement() on reader.
Wednesday, March 27, 2013
Well I do not know why to make this process faster apart from practicing it initially as much as possible. and if you have other suggestion please include in comment and I`ll update this post with credits to you :)
I am going to answer, How to learn c#, to Learn c# here are some of the posts, sites that I found useful
MSDN is really a good source of knowledge and actually this is the preferred place to get any new feature detail, but this contains basic information and you have to try hands-on to know many hidden things or boundary conditions.
More detailed list http://msdn.microsoft.com/en-us/library/Vstudio/kx37x362.aspx
2. Channel9.msdn (http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners)
This is second in my priority list as its really a good site with lot many videos, to learn c# they have created a list of videos and they are sequentially arranged at the given URL.
3. Pluralsight Videos : http://www.pluralsight.com/training/Courses/TableOfContents/dotnet-csharp-tutorialThese courses are created by industry experts and they surely has great in depth knowledge about subject. These videos are structured and time bound. These are really good source of knowledge but these are not free, you need to have subscription to access these videos. C# videos were published in 2009, not sure if they have updated them for new version of C# or not, If you know, please provide those details in comment section.
5. About.com (http://cplus.about.com/od/learning1/Learn_about_C_and_how_to_write_Programs_in_It.htm)
This site is very good source of information and they have plenty of them, but only problem that I find with about.com is its not well structured and any new member get lost in their vast information.
If you know any other good source that you want me to put into this list. Please share that in comment section and I`ll include in the list.