Skip to main content

Posts

Showing posts from 2013

Error : Task Scheduler - This task requires that the user account specified has Log on as batch job rights

In one of the production environment, we were running with low disk space problem because of the logs. To cleanup the old logs created a  task within the scheduler and have specified "Run whether use is logged on or not". The user account we used was the system logged on user. The task was running fine, after few months as a security policy the password expired. Since the old password expired we had to apply the new password for the task also, but this time we decided to create a new account specifically for the task scheduler with password never expire option. While setting up the new user account and password, run into the below issue: "The task required that the user account specified has log on as batch job rights" To fix the issue follow below steps: From Run type "secpol.msc /s" and enter, the local security policy snap in will open. Select "Local Policies" in MSC snap in Select "User Rights Assignment" Righ...

WCF Exception - The maximum message size quota for incoming messages (65536)

The WCF service error 'maximum message size quota for incoming messages (65536) has been exceeded generally occurs, if the message size is larger than the "maxReceivedMessageSize" configured parameter value in the binding.   By default the parameter "maxReceivedMessageSize" value is set to 65536, if you encounter this error change the default configuration parameter value as per the message size and also ensure the "maxBufferSize" and "maxReceivedMessageSize" values are set to same value.   < binding name = " BindingName " closeTimeout = " 00:10:00 " openTimeout = " 00:10:00 " receiveTimeout = " 00:10:00 " sendTimeout = " 00:10:00 " allowCookies = " false " bypassProxyOnLocal = " false " hostNameComparisonMode = " StrongWildcard " messageEncoding = " Text " textEncoding = " utf-8 " maxBufferSize = " 9999999 " maxRec...

AngularJS

AngularJS is an open-source JavaScript framework, maintained by Google. Its goal is to augment browser-based applications with model–view–controller (MVC) capability, in an effort to make both development and testing easier. Why AngularJS: HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets to extend HTML vocabulary for the application. The resulting environment is extraordinarily expressive, readable, and quick to develop. AngularJS is a toolset for building the framework most suited to application development. It is fully extensible and works well with other libraries. Benefits: Uses primitive JavaScript types instead of function wrappers Don't need to write all the event listening and event triggering, loaded with functionality Decouple the client side of an application from the server side. This allows development work to progress in parallel, and allows for reuse of b...

WCF Service Exception PlainXmlWriter+MaxSizeExceededException

For a WCF service the exception 'System.ServiceModel.Diagnostics.PlainXmlWriter+MaxSizeExceededException' generally occurs when we switched on logging and tracing.   A message was not logged. Exception: System.InvalidOperationException: There was an error generating the XML document. ---> System.ServiceModel.Diagnostics.PlainXmlWriter+MaxSizeExceededException: Exception of type 'System.ServiceModel.Diagnostics.PlainXmlWriter+MaxSizeExceededException' was thrown.   The reason is that "maxSizeOfMessageToLog" configuration parameter value is set to a value lower than the size of the message to log. < system.serviceModel>   < diagnostics > <!-- log all messages received or sent at the transport or service model levels --> < messageLogging logEntireMessage = " true " logMessagesAtServiceLevel = " true " logMalformedMessages = " true " logMessagesAtTransportLevel = " true "    maxMessa...

Entity Framework benefits and liabilities compare to NHibernate

Entity Framework is one of the most popular ORM framework on the .NET world, it enables to work with relational data using domain-specific objects and eliminates the need for most of the data-access code. EF 1 came out with .NET 3.5, EF 5 released targeting .NET Framework 4.5 and is now on EF 6 alpha3. For Entity Framework, the ObjectContext or DbContext holds the configuration, model and acts as the Unit of Work, holding references to all of the known entity instances. Below are few of the Entity Framework benefits and liabilities compare to NHibernate: Benefits: Entity Framework and NHibernate both default to change tracking at the unit of work level, also offers self-tracking entities. Entity Framework of has close integration ties with Visual Studio and various ASP.NET and WCF libraries. Entity Framework has a great LINQ support Entity Framework is superior on documentation and NHibernate lacks and need to synchronize with an up to date API reference with its current vers...

sqlproj is not supported by this version error

Today I have got "sqlproj is not supported by this version" error while opening my solution in Visual Studio 2010. The reason was I have installed VS 2012, while migration the database project extension got changed from *.dbproj to *.sqlproj. Basically VS 2012 converts .dbproj files into .sqlproj files, which VS 2010 can’t open. To resolve the issue of *.sqlproj interoperability, install the SQL Server Data Tools (SSDT) for VS 2012 and VS 2010. You can download the SSDT from  http://msdn.microsoft.com/en-us/data/hh297027

Implementing Parallelism With A SearchResultCollection

Implementing Parallel.ForEach with a SearchResultCollection: The below piece of code helps to check the given user is a part of the given active directory group. To implement Parallel.ForEach with a SearchResultCollection, do the casting with the SearchResult object and covert it into a list. //// Directory Searcher var directorySearcher = new DirectorySearcher(string.Format("(CN={0})", groupName)); //// Find group var searchResultCollection = directorySearcher.FindAll().Cast ().ToList(); Parallel.ForEach(searchResultCollection, searchResult => {  // enumerate members  var resultPropColl = searchResult.Properties;  Parallel.ForEach(resultPropColl["member"].Cast ().ToList(), member =>  {    var memberEntry = new DirectoryEntry("LDAP://" + member);    var userProperties = memberEntry.Properties;    if (GetUserNameFromProperties(userProperties, "sAMAccountName") == userName)    {      return true; ...

Modern.IE

Microsoft Launches Modern.IE to test the web applications against various (modern and legacy) versions  of IE. http://www.modern.ie/ http://www.modern.ie/ You have to use "Scan a webpage" link http://www.modern.ie/report   to run the website. After scan, It provides a detail report. Watch the video to know more.. http://www.modern.ie/about  

50 Ways to Avoid, Find and Fix ASP.NET Performance Issues

50 Ways to Avoid, Find and Fix ASP.NET Performance Issues : redgate published a free eBook on ways to avoid, find and fix ASP.NET performance issues. The book has 50 solid recipes. If you haven't got the chance to read yet, grab your free copy from the below link: 50 Ways to Avoid, Find and Fix ASP.NET Performance Issues