Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Tuesday, January 27, 2009

Office Development with VS 2010

Get up to date with office development on .net platform with Somasegar's post here

My personal favourite is simplification of .net's integration with COM's OM.

As per the example posted in Somasegar's blog.

Instead of doing the following

object fileName = "Test.docx";

object missing = System.Reflection.Missing.Value;

doc.SaveAs(ref fileName,

ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing);


You can do with VS 2010

object fileName = "Test.docx";

doc.SaveAs(fileName);

Saturday, July 26, 2008

The invoked member is not supported in a dynamic assembly

When i tried running an ibattis related unit test fixtures in my exsiting test assembly I started getting this wierd error that's a known bug documented at http://support.microsoft.com/kb/327131.

Interesting thing is that when i run that fixture in a separate assembly it works fine but as soon as i add it to existing test fixtures it crashes with this error :"The invoked member is not supported in a dynamic assembly".

I think it has to do with how nUnit created dynamic assemblies for test fixtures internally. Unfortunately i cant change that behavior. So for now the work around is to use a separate assembly.

Embedded sqlMap.config

If you are like me you would like to embed sqlMap.config file for your ibatis project. Although its not provided out of the box but its very simple to implement.

All you have to do is to write your own sqlMapper implementation.The core logic revolves around building DomSqlMapBuilder.

protected static void InitMapper()
{
DomSqlMapBuilder builder = new DomSqlMapBuilder();
XmlDocument sqlMapConfig = Resources.GetEmbeddedResourceAsXmlDocument("YourNamepspace.YourConfigFile.config");
mapper = builder.Configure(sqlMapConfig) as SqlMapper;
}



for more details do check out http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+use+an+embedded

Thursday, May 15, 2008

Training on .Net

Last week i concluded 3 part series of sessions on .NET and C#. I started off with basics and moved to advanced topics. These were all inhouse sessions for . We got good feedback on all sessions and we will continue holding such events in the future.