AppDev: Something You Should Know by Irena Kennedy

Everything that is related to application development, and other cool stuff...

Browse by Tags

Tagged Content List
  • Blog Post: SYSK 394: Cost of getting StackTrace and finding a StackFrame

    I wanted to find out the overhead of getting the stack trace and finding a specific method in the array of stack frames. The profiled code looked like this: private static MethodBase GetCallerMethod(string caller) { StackTrace st = new StackTrace(2); return (from f in st.GetFrames() let m...
  • Blog Post: SYSK 393: Error: Cannot obtain Metadata (RESOLVED)

    Not all error messages are created equal, and some of them are less helpful than others. Here is one I came across -- "Metadata contains a reference that cannot be resolved... An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior...
  • Blog Post: SYSK 392: WebActivator Under The Hood post by Suhas Rao

    Check out a good post by one of my coworkers -- http://blogs.msdn.com/b/suhasaraos/archive/2014/08/13/webactivator-under-the-hood.aspx
  • Blog Post: SYSK 391: Entities as a data contract

    There may be instances when using data transfer objects (DTO) is appropriate. For example, if you need to control the serialization details, such as which members to serialize and which not to serialize, and if you need to change the names of the serialized members, or do data contract mapping based...
  • Blog Post: SYSK 389: How to set ClientCredentials via Configuration file in Client

    I’m working on a project where a service hosted elsewhere requires Windows authentication. As a consultant, my computer is not on the customer’s domain, so, using my logged-on Windows credentials won’t do any good. And, doing nothing results in the following exception : “The caller...
  • Blog Post: SYSK 387: Resolving Data Type Conversion Error

    Consider the following line of code: AttendeeAvailability attendeeAvailability; . . . if (attendeeAvailability.WorkingHours.DaysOfTheWeek.Contains(DateTime.Today.DayOfWeek) == false) { . . . } You’ll get a compile time error -- Argument 1: cannot convert from 'System.DayOfWeek' to 'Microsoft...
  • Blog Post: SYSK 386: Performance Implications of Using One vs. Several Nested Hashtables

    Let’s say you need to quickly find some reference/lookup data and you decide to use hashtables… If your key is comprised of several elements, is it better, from the performance point of view for you to combine all of them into one string and use it to access a flat single hashtable, or,...
  • Blog Post: SYSK 385: Smart Cache

    John Manaloto, one of the architects I’ve worked with recently, has been kind enough to allow me to publish the “smart cache” class he’s put into one of his projects… It’s a component built on top of Microsoft Caching Application Block from the enterprise library...
  • Blog Post: SYSK 383: FileSync Tool

    Last weekend I wrote a utility that does file synchronization (yes, I know there many such tools), but where I can define in advance what I want to see happen if there are discrepancies, e.g.: If you think you might benefit from it, attached is the source code and the executable (in the bin\debug...
  • Blog Post: SYSK 382: File Comparison

    Last weekend I wrote a utility that does file synchronization (yes, I know there many such tools), but where I can define in advance what I want to see happen if there are discrepancies… To do that, I needed a class that would take an array of file names from one folder and another array of files...
  • Blog Post: SYSK 381: How To Get One Callback When Multiple Async Services Calls are Completed

    My current project uses Silverlight 4.0 and RIA services, and I quickly came to realize the benefits and the challenges of all DomainService calls being asynchronous. Consider this scenario: a Silverlight client app needs to get some data, that requires multiple DomainService calls – it may...
  • Blog Post: SYSK 380: How to Get Rid of Double Scroll Bar in Microsoft Report Viewer Control

    Special thanks to David Petersen who has submitted this post! If you ASP.NET page that contains the Report Viewer Control, has double scroll bars, you can remove them by including two separate form elements on the page: 1. First <form> element Includes your Headers and so forth ...
  • Blog Post: SYSK 376: Utility to Add DateTaken as File Name Prefix

    I like to view photo images (.jpg files) using Large or Extra Large Icons view in Windows Explorer. Unfortunately, this view doesn’t give me a way to sort the files by DateTaken property… So, as a workaround, I created a small application that uses the date/time as a file name prefix, thus, letting the...
  • Blog Post: SYSK 375: Visual Studio Add-In for Managing Configuration Files Across Environments

    One of common customer questions/requests I get is about industry best practices and recommendations on managing configuration file settings when deploying code across environments. There are several options to change different configuration settings in web.config file based on whether the application...
  • Blog Post: SYSK 374: Role Based Authorization for WCF Services through Configuration Files

    Traditionally, to implement role based authorization in .NET you would use PrincipalPermission attributes, e.g.: [ PrincipalPermission ( SecurityAction .Demand, Name = "YourDomain\\User1" , Role = "YourDomain\\Role1" )] public void MethodX( ... ) { . . . } In my opinion, there...
  • Blog Post: SYSK 373: How to Impersonate the Original Caller When Calling the WCF Service in ASP.NET by Configuration Only

    If your WCF services use role based authorization, and you need to pass the identity of the end user (original caller), you have a few options: 1. Use <identity impersonate=”true” /> in web.config This is not my preference since there is quite a bit of overhead with doing security context...
  • Blog Post: SYSK 370: The Performance Cost of Extension Methods

    First, for those who may not be familiar with this feature, .NET 3.5 allows developers to add methods to existing types without using inheritance or partial classes by creating static methods that can be invoked by using instance method syntax. When I first heard about this feature, it reminded...
  • Blog Post: SYSK 365: How to get your unit tests (test project in Visual Studio 2008, a.k.a. MSTest) run multithreaded

    If you want to test code that requires an MTA threading model (e.g. the code being tested uses WaitHandle.WaitAll), you need to change the .testrunconfig file manually and change the threading model from STA to MTA. There are other posts that say for VS 2005, you add the following line to the config...
  • Blog Post: SYSK 364: AJAX Extensions 1.0 Source Code and Debug Symbols

    Did you know that AJAX Extensions source code and debugging symbols are available to everybody at http://www.microsoft.com/downloads/details.aspx?FamilyID=ef2c1acc-051a-4fe6-ad72-f3bed8623b43&DisplayLang=en ?
  • Blog Post: SYSK 362: The cost of try/catch

    Since I’m still coming across a lot of conflicting recommendations on the “best practices for structure exception handling” (including those coming from different folks from Microsoft), I decided to write a blog post on the topic. So, what are the benefits and costs with SEH? Let me first...
  • Blog Post: SYSK 361: On the importance of signing assemblies from the versioning perspective

    There are many reasons for signing your assemblies (security being at the top of my list), but in this post I’d like to address the importance of using a key to sign your assemblies from the versioning point of view. Now, let’s assume for the sake of this discussion, that we’re talking about private...
  • Blog Post: SYSK 359: How to Purge Workflow Tracking Data Inserted By SqlTrackingService

    To my great surprise, after doing a search for a script that would delete the events logged by the almighty SqlTrackingService service, I didn’t find one… So, I quickly created it (see below), and it seems to do the job just fine given the current table schema implementation used by the service: IF...
  • Blog Post: SYSK 358: Run Rules Automatically When an Event Is Triggered

    Imagine this: you’re writing a custom user control and you’d like to execute a WWF ruleset when a certain event happens, e.g. a data context changes. Of course, you could create a delegate for the event and write a few lines of code to validate and execute a desired rule… But what if you had to do it...
  • Blog Post: SYSK 356: How To Execute A Workflow Synchronously Without waitHandle.WaitOne()

    Consider the following code snippet frequently found in sample applications, code snippets and published articles: using ( WorkflowRuntime wr = new WorkflowRuntime ( "WorkflowRuntimeConfig" )) { wr.StartRuntime(); using (System.Threading. AutoResetEvent waitHandle = new System.Threading...
  • Blog Post: SYSK 354: How To Determine If The Page_Load Event Is Triggered by a Standard Page Postback or by the UpdatePanel?

    Ok, so you’re in a Page_Load code block, and the this.Page.IsPostBack returns true . How do you know if the request is due to a “standard” page postback or as a result of an UpdatePanel triggered postback resulting in a partial page update? The answer is simple: when the postback is caused by a...
Page 1 of 7 (151 items) 12345»