Tuesday, September 25, 2007

xUnit.net

The guys who wrote NUnit have announced that their creating a new and improved testing framework. Here's a comparison of all the unit testing frameworks: http://www.codeplex.com/xunit/Wiki/View.aspx?title=Comparisons&referringTitle=Home

I'm definitely interested in some of the changes their making. What does this mean for MSTest?

Friday, September 21, 2007

Managing config files

Here's a good article about managing multiple config files. It definitely seems like a better method than having 435 different xml settings files ;)

http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx

Labels:

Thursday, September 20, 2007

New candy bar

Here's a Bacon Candy bar, milk chocolate + Applewood smoked bacon.

http://www.vosgeschocolate.com/product/bacon_exotic_candy_bar/exotic_candy_bars

I may have to try some bacon dipped in chocolate this weekend.

Labels:

Tuesday, September 18, 2007

TFS Guidance Documents

Here's some links to TFS guidance documents, so I don't lose them again.

The first one is for structuring team projects: http://www.codeplex.com/BranchingGuidance/Wiki/View.aspx?title=Guidance%20for%20Structuring%20Team%20Projects

The other deals with source control branching: http://www.codeplex.com/BranchingGuidance

 

And here's a downloadable guide:

http://www.codeplex.com/TFSGuide

Labels:

Thursday, September 13, 2007

WCF Debugging with SvcTraceViewer

While debugging my recent WCF problems, I ran across this utility that I had forgotten about. SvcTraceViewer is a tool that helps visualize and analyze diagnostic traces generated by WCF. Not only does it show you every message received and sent, but in graph mode it give you a quasi-sequence diagram of activities.

You can enable tracing by adding a section to the config file:

    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
                <listeners>
                    <add name="traceListener"
                        type="System.Diagnostics.XmlWriterTraceListener"
                        initializeData= "c:\log\Traces.svclog" />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

This will send the tracing info to a log file which then you can open with SvcTraceViewer;

Here's the link to more information: http://msdn2.microsoft.com/en-us/library/ms732023.aspx

Labels:

WCF calls timing out

So I was building a prototype of a WCF service hosted in a windows service and everything seemed to be working fine, until I started calling the service with multiple clients. After 10 (successful) calls to the server, the server quit responding and any subsequent calls from the client would timeout.

As it turned out there were a couple of problems:

I was hitting the max concurrent sessions limit, which defaults to 10, after my session limit was hit the rest of the calls went in the bit bucket. So, of course I upped my session limit, and it fixed the problem temporarily until I hit the limit again. Then I realized that my client wasn't closing the session. I actually had a readline so I could verify the output, and at this point the session was still open. So I added a call to close the service proxy. If the readline had not been there the proxy would have gone out of scope, the session would have been closed automatically and I wouldn't have seen this problem. Also, if I had been using a non-sessionful channel such as BasicHttpBinding, I wouldn't have seen this. Oh well...

 

Things learned:

In the service behavior you can set (in serviceThrottling) -

MaxConcurrentCalls - this is the total number of simultaneous calls to process (default is 16)

MaxConcurrentSessions - total number of sessionful channels to accept (default is 10), this is disabled for non-sessionful channels such as BasicHttpBinding

MaxConcurrentInstances - total number of instance contexts created (default is Int32.MaxValue)

The purpose of these settings is to protect against DoS attacks.

Also, if you are using a sessionful channel, close it.

Labels:

Lost Origins

Here's an interesting article on the guy who wrote the first draft of the pilot for Lost

 

http://www.chicagomag.com/Chicago-Magazine/August-2007/Cast-Away/index.php?cp=1&si=0#artanc

Labels:

Friday, September 7, 2007

Windows Workflow

I was having problems trying to pass a mock object to workflow b/c the mock wasn't serializable. The workflow held a private instance of the object and when the workflow idled it tried to serialize all the members. You can get around this by marking members with the [NonSerialized] attribute, then the workflow won't try to serialize the member.

Labels:

Thursday, September 6, 2007

VS Region Add-In

Here's an VS add-in that allows you to highlight sections of code and add to an existing region or create a new region, very handy.

This is the 2k3 version: http://www.codeproject.com/dotnet/RegionsAddIn.asp

And here is an updated 2k5 version:

http://janyou.bokee.com/index.html

Labels: