My first Silverlight App
Source is available @:
http://cid-0476ca5e9f26e63c.office.live.com/embedicon.aspx/Public/Documents/SilverLight/MyApp.zip
About Me
- Saran
Categories
- .NET (2)
- assembly not copied (1)
- Asynchronous logging (1)
- Asynchronous logging application block (1)
- Enterprise library (1)
- exception handling application block (1)
- logging application block (1)
- Silverlight tree (1)
- Sql Server 2005 (1)
- SSIS (1)
- SSIS configuration file warning (1)
- SSIS packages (1)
- Visual Studio 2008 Install-fest (1)
- VS 2008 Installfest (1)
Blog Archive
Thursday, October 15, 2009
My first Silverlight App
Posted by
Saran
at
10:52 PM
23
comments
Labels: Silverlight tree
Thursday, January 31, 2008
SSIS configuration file warning
While trying to run one of our SSIS packages after migrating from development to string testing I got an interesting warning message.
Warning: 2008-01-31 16:02:38.88
Code: 0x80012014
Source: Package_Name
Description: The configuration file "X:\\Package_Name.dtsConfig" cannot be found. Check the directory and file name.
End Warning
Warning: 2008-01-31 16:02:38.88
Code: 0x80012059
Source: Package_Name
Description: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed.
End Warning
I was trying to run the package using the dtexec utility with the /conf option. At design time the package was bound to the dev config file. After the migration to the string environment I wanted to run the same package but pointing to the string config file. And that raised the above mentioned error.
This happens because the package configuration file name and location are embedded into the package.
<:Property DTS:Name="ConfigurationString">X:\\Package_Name.dtsConfig</DTS:Property>
And at run time the package first looks for the file bound at design time rather than the one you specified in the dtexec command. But this is only a warning. The package runs properly after this warning message.
So I understand that the SSIS package first looks for the design time configuration file and then goes for the file specified in /conf option.
One more thing I noticed while deploying a package to a file system is you are not allowed to type the path. The control is disabled!!
I had to install the SSIS package in a LAN share whose path I know very well. As I was not able to key in the path, I had to search hard for the share in the "Entire Network" node in the folder browser dialog. This is a tedious way of doing it as the company I work for has N number of systems and servers out there in the network. It would be much better if you were allowed to key in the path.
Posted by
Saran
at
4:24 PM
1 comments
Labels: Sql Server 2005 , SSIS , SSIS configuration file warning , SSIS packages
Wednesday, January 30, 2008
Asynchronous logging using Logging Application Block
A quick search in the web for asynchronous logging using Logging Application Block revealed that there is only one way of doing it, using MSMQ and DistributorService.
I don’t have the option of using MSMQ for my application. So I put together a small solution for this problem using Jon Skeet’s asynchronous helper class called ThreadUtil [Thanks Jon]. The helper class has a method "FireAndForget" through which we can make an asynchronous calls without worrying about leaking handles. The helper class takes care of calling the EndInvoke and closing the waitHandle.
My solution is to use the helper class and make asynchronous calls to the Logging application block.
The sample can be downloaded from:
Update:
In the asynchronous helper class the call to EndInvoke should be wrapped with in a try catch block. If not & if there is an exception while running the asynchronous method, it will be raised by the runtime when we call EndInvoke. If the exception is not handled at this point it would crash the whole application!
The new updated sample can be downloaded from:
http://cid-0476ca5e9f26e63c.skydrive.live.com/self.aspx/Public/Documents/AsynchLogging_Updated.zip
Posted by
Saran
at
2:34 PM
0
comments
Labels: .NET , Asynchronous logging , Asynchronous logging application block
Tuesday, January 29, 2008
Enterprise library logging & exception handling application blocks
I am creating a tool which automates the build process of our application. I was using the logging & exception handling application blocks from enterprise library. I encountered an interesting problem.
The “Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging” assembly that is used by the exception handling block to log the exception through the “Logging Handler” is not copied over to the main project output directory.
This issue is also discussed in the following URL : http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=18926
My visual studio solution had a GUI project [windows forms], which references a custom helper class library for logging. The custom library has references to the “Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging” assembly with CopyLocal property set to true. When I build the solution the assembly is copied to the output directory of the class library but not to the main GUI project. So when my application tries to log an exception it fails.
As a workaround I added a using statement to one of the classes in the class library.
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;
I also added a dummy statement in the code.
LoggingExceptionHandler exceptionHandler = null;
Now the assembly is copied to the main GUI project output directory . If I comment out the above code the assembly is not copied to the output directory.
I guess Visual Studio copies the assemblies to the output directory of main project only if they are referred in the code. Another work around is to use the post build event to copy the dll to the output directory.
Sample:
http://cid-0476ca5e9f26e63c.skydrive.live.com/self.aspx/Public/Documents/WindowsApplication3.zip
Posted by
Saran
at
3:50 PM
1 comments
Labels: assembly not copied , Enterprise library , exception handling application block , logging application block
Thursday, December 13, 2007
Visual Studio 2008 Installation Experience
The installation experience of Visual Studio 2008 is good. It’s pretty smooth. I choose to install all the options. It took 4.3 GB and 75 minutes to install the whole stuff excluding MSDN in my system [Pentium M 1.7 GHz with 1GB ram].
The installer didn’t ask me to restart the system in the middle. That’s one good thing. I hate re starting a system while installing software. But I had to restart the system at the end.
After installation I tried creating a Hello World web site, and it worked flawlessly. Thanks a lot for Brad [IndyNDA.org] and Microsoft for this awesome Christmas gift :-D.
Posted by
Saran
at
7:36 PM
0
comments
Indy Vs 2008 Install Fest
WOW I can’t believe it !!!. I am installing Visual studio 2008 Professional right now!!! I was expecting to start after 6:00 PM today. Good for me ;-)
I came to the Gene B. Glick at 5:00pm thinking that I would be the first person. But there were a lot of people waiting there to my surprise!!!. The event organization is so good; I got into the conference room immediately.
Lets see how the day turns out to be.
Posted by
Saran
at
6:01 PM
0
comments
Wednesday, December 5, 2007
Microsoft Architecture Journal Reader
Came across the new "Architecture Journal Reader" from microsoft.
This a nice offline reader for the architecture journal. The content downloaded is available offline and also searchable.
http://www.microsoft.com/downloads/details.aspx?FamilyID=dd466bbb-1b7d-438e-9f9a-954ce2058f15&DisplayLang=en
Posted by
Saran
at
11:01 PM
0
comments
Visual Studio 2008 Install-Fest
Wow i am going to the VS 2008 Install-Fest on Dec. 13th in Indianapolis, Courtesy of Indy .NET User group. Hope I get a free copy of VS 2008.
IndyNDA [indynda.org] has restricted the number of free VS 2008 distributed to 175. I don’t see this kind of restriction in any other Install-Fest held around the country.
Also I don’t understand why Indy developers have this restriction while others around the country enjoy a free copy if they attend install-fest. Are Indy .NET developers being discriminated?
Posted by
Saran
at
8:19 PM
2
comments
Labels: .NET , Visual Studio 2008 Install-fest , VS 2008 Installfest
Monday, November 5, 2007
Binding a complex object to DetailsView
One of the common requirements while building an application is to bind to your domain objects. .Net has some excellent features for doing this.
Recently I was experimenting with Details view and binding it to a domain specific object. The default binding works fine if the object properties are of simple type.
What if the Object has a property that itself is an object. Assume that we have a user object which represents a user in the application [like a customer]. The user will have a name, age. So far it’s good. The default binding will bind to the objects simple properties.
But Customers will have addresses. For dealing with this usually we create an address object and expose it as a property of the User object. Now if you bind the user object to the DetailsView the default data binding skips the address property.
Ok, how to get your customers address displayed in the details view. There are a couple of was to do it.
If you are just concerned about displaying data, then the short and easy way is to override the ToString() method of the inner objects. For example if you override the ToString() method of the Address object so that it returns a string which contains all the address information, then the default binding will display the address! If you follow this path and if you are not careful your object might end up knowing all the display details.
Another way is to use and template fields in combination. But this is one way binding. We have to write up code that hooks up to proper events for editing and inserting. We can not use the Bind method for two way binding. It raises an error saying that the syntax for the binding expression is not correct.
One another approach is to create custom DataControlField object which can handle the inner object of type Address. Dino Esposito has a very good article on this @ http://msdn.microsoft.com/msdnmag/issues/06/01/CuttingEdge/. You can follow this approach if we need more specialized presentation.
Posted by
Saran
at
3:34 PM
0
comments
Monday, September 10, 2007
Beware of String.IsNullOrEmpty
A very useful method when used with caution. Yes with caution!
Recently I was asked by our BA to use the IsNullOrEmpty method while checking for the existence of value in a string variable. Its new to me. He said that it has more performance than the usual way of doing this.
I decided to dig more about this. In the next 15 minutes i found that it has its own issues.
Yes issue, a very big one !
When used inside a loop it will crash the whole application. No error handling works here.
This is caused by JIT optimization.
Bill has a good write up about this here: http://msmvps.com/blogs/bill/archive/2006/04/04/89234.aspx
Note this happens only when you build your application in release mode with optimizations on.
Microsoft has the following page on the issue. Fix is available only in Orcas.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=113102
Well, as for me I am now fixing those IsNullOrEmpty method calls along with the rest of the team .....
One more issue to fix ................................................... ;-)
Posted by
Saran
at
9:09 PM
0
comments
Hello World !!!
Yes .... this is my hello world in the BLog world.....
Just like starting to learn one more language...... ;-)
Posted by
Saran
at
8:57 PM
0
comments