Archives
-
Is your IDE screwed?
I recently uninstalled some non-functioning VS.Net add-ins, that really screwed up my IDE and i started getting these messages on build"Load of property 'AllowUnsafeBlocks' failed."
"Load of property 'ApplicationIcon' failed."
"Load of property 'AssemblyKeyContainerName' failed."and so on...All projects got the Output type set to Application and ofcourse i could not build, the csproj files were all ok so obviously it was the IDE that was screwed and this just one week from release ... aaargh!!Anyways if you ever face this problem this link saved my buttBasically what you need to do is register csproj.dll all over againThe suggested solutions wereregsvr32 "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\vcpackages\csproj.dll"
regasm "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies\VSLangProj.dll"
devenv /resetskippkgsThe first one worked for me. -
Unfair labour practises at EA
I am an avid game lover and big EA fan but this journal entry of an EA employee has really shocked me. Can you imagine working 90 hours a week!!!!
-
Damn CS-RCS
Yesterday, i installed CS-RCS from ComponentSoftware, i was looking for a configuration management component which we could integrate into our product which needs to support document versions. ( I still haven't found any suitable candidates) So anyways i try to open the solution today and it says that source control status is invalid. After beating my head for one hour trying to figure out what was wrong with VSS i saw that the repository selected was CS-RCS...aaargh, the least these guys could have done was provide a SCC switcher like these guys and this guy and this guy and this guy have already done. Is that too much to ask? (Even i didn't know there were so many options before i googled)
It turns out that CS-RCS changed my SCC provider to CS-RCS now to restore it i had to execute ssint.exe from vss\win32 folder and i could access source control now. But the episode was really nasty, especially coming from a company that makes configuration management tools. So if any guys from ComponentSoftware are listening, please provide a SCC switcher or atleast restore the previous one on uninstallation.
-
Great interop site
Came across a great site for Interop related info . The site is by Mattias Sjögren a MVP. It has great links to sample code, FAQ's and articles on .Net Interop.
-
Differences between OleDb and Sql in ADO.Net
I usually develop applications that use SQL server so i never really had a chance to work with Access DB before. So yesterday i had to write some data to an access DB and i thought how different can it be. So i set up my queries and parameters as usual, althought it felt a little strange having to write SQL code in VS.Net :) , and i run the app and obviously it bombs. That was expected but the error was a little strange what is got was "Data type mismatch in criteria." hmm...so i look up my OleDbTypes that i have setup for my params seemed OK to me.
-
Build Management in .Net
I recently had to do some research on build management techniques for .Net. Atleast till MSBuild comes out with VS.Net 2005, the existing tools available from MS are not upto the mark. Here are some intresting links and tools i came across
http://www.theserverside.net/articles/showarticle.tss?id=NAnt
http://www.15seconds.com/issue/040621.htm
http://radio.weblogs.com/0106046/stories/2002/08/10/supportingVsnetAndNant.html
Slingshot is a tool that converts .sln files to NAnt build scripts ,it is part of the NAntContrib project, there are some great tools
for NAnt in this project
http://sourceforge.net/projects/nantcontrib
For continuous integration
http://hipponet.sourceforge.net/
http://cruisecontrol.sourceforge.net/
Team Development Guide from MS and MSBuildIt
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=94FDB8C8-5A87-4545-AF75-6053F32C7ECA
http://www.microsoft.com/downloads/details.aspx?FamilyID=b32497b0-77f7-4831-9c55-58bf3962163e&DisplayLang=en
-
Two great tools
Came across two great tools today
1. NUnitForms - Want to do unit testing for WinForms, this project is for you. Start contributing.
2. BKResizer - I one problem i always faced with WinForms development was resolution independence. BKResizer solves that problem for me, and is not to hard on my pocket either,
-
GUI design patterns again
Jeff points to another good site on UI design patterns
-
Gold mine for bibliophiles...if it is legal?
Came across this link on my local Delhi .Net usegroup, the site has a lot of O'Reilly publications online, FREE! but i am not sure that it is entirely legal, considering that Safari which hosts the same content is a paid service.
-
2 good blogs
Came across two great blogs today
-
The x86 Prayer
Found this amazingly geek goody on Matt's site ( Shame on you if you don't know who he is) . I was literally ROTFL after reading this,
Our Caller, who art on the stack frame
Hallowed be thy Parameters
Thy Address Space come
Thy I/O be done
In Registers, as it is in Memory
Give us this day our periodic timeslices
And forgive us our page faults
As we forgive those who pass invalid parameters
Lead us not to unconditional JMPs
But deliver us from segment registers
For thine is the Address Space, the Registers, and the I/O ports
Jmp $
Ret
-
Quick Reference : Base64 and UUEncode
Base64 and uuencode allow us to send arbitrary binary data through systems that only allow plain ASCII (e.g. Email RFC 822).
-
OpenWave Mobile SDK
If you are into developing mobile applications, you might want to take a look at the OpenWave Mobile SDK . Deepak Gulati was using it in the TechEd 2004 session held in delhi. It seems to have some nice emulation features.
-
TechEd 2004 Delhi, India
TechEd 2004 was held in Delhi from Aug 25-27. We had planned to organize some community evangelizing for our user group (Delhi .Net SIG) at TechEd. To be honest things didn't work out as planned, most of the time was spent on the Passion Quotient contest, which was basically all about WindowsXP SP2. We gave away some cool SP2 watches but didn't get too many new members for our community.
The event itself was great, got to look at a lot of cool technology coming out of Redmond. Here is a day by day summary.Day 1We started out with a keynote address that was basically Microsoft's vision for the next 5 years. The slides that we saw in the keynote were to be standard in all sessions. Strangely there was not much talk about Longhorn, but more about Whidbey and SQL Server 2005.The first session was about Visual Studio Team System, the whitehorse designers totally blew me away, If it is implemented as well as it is visualized this could be a killer. The class designer with complete round trip engineering support was cool. Debug Visualizers are a great addition. Also the project properties can now be used to configure a lot more stuff like security and deployment via ClickOnce (more on that later).The next session was on the new features in the CLR by Tarun Anand. The SQL-CLR integration is a great new feature. I will be exploring that in the coming days and hopefully should be able to post some info on that. Other than that Tarun also talked about generics.Next up we had a session in which the new WSE 2.0 features were discussed, there is some really good stuff coming out of redmond in this field. I was especially impressed with WS-Transactions, if that gets implemented it's going to be absolutely great.For the next session, i switched from the developer track and attened the DBA track on SQL-CLR integration. Mahesh Prakriya was such a wonderful speaker and gave some very good insights into why some things are implemented in a paticular way inside SQL-CLR. One intresting thing to note is that currently to host the CLR in your app, you need to implement 4 COM interfaces, in CLR 2.0 there are about 50 interfaces available to runtime hosts to minutely control the behaviour of the CLR!Day 2 The day started out with a session on BizTalk server 2004. BizTalk is one helluva good product and i am looking forward to working on it.Next up was Tarun again with ClickOnce, which is basically an attempt to give smart clients the ability to automatically update themselves. Well there is nothing radically new in the implementation, i will be writing more about this technology in a different post. But one thing that struck me was the inability to do incremental updates, which IMHO is a very serious disadvantage. Also some initial inspections showed that the app was getting installed not in 'Program Files' but in 'Documents and Settings' Folder.Next Deepak Gulati (Developer Evangelist, Microsoft India) gave a nice talk on mobile app development with VS 2005. The unified control architecture for mobile controls is a good idea and will help in reducing development headaches across various mobile platforms. The demos for this session were among the best at TechEd 2004, illustrating the concept and ease of the technology very well. Hats off to Deepak.The last session fo the Day was ASP.Net data controls by Vinod Unny, the new controls that ship with ASP.Net 2.0 are so cool. Easy to use, easy to configure, consistent architecture. This is what makes it such a joy to develop with MS technologies. Unfortunately VS.Net simply refused to work and we were unable to see some of the demos, nonetheless a great session.Day 3Day 3 was the hands - on lab, i had registered for the VSTS lab and got to work for 3 hours on the new VS 2005 class designers and whitehorse. I must say the product was surprsingly stable for a Beta 1, although some bugs were encountered.In general my feeling about TechEd was that it was too much marketing. I mean this is supposed to be meant for developers, not for managers who have to sell this technology to their bosses. My eyes start to glaze over after going through 3-4 ppt slides, have more demos please, code speaks volumes more than a ppt can. If anyone from MS is reading this, please have more demos, don't show us abstract ppt's show us concrete code.Well we got SQL Server 2005 Beta 2, VS.Net 2005 Beta 1 and ISA 2004 Beta 2, RC1. I have already installed whidbey on my Virtual PC 2004, looking forward to exploring the new technologies. Also i was unable to install SQL Server on my VPC, the error message indicated that SQL Server and VPS were not compatible, so i installed SQL Server Express edition instead. -
Want to hack using google?
Check out how you can hack by using google. Really shows you how powerful google can be. Totally blew me away http://johnny.ihackstuff.com/
-
Good UI controls
Nice UI controls, free for personal use. http://www.dacris.com/netxp/
-
Rapid Data Forms Development
I discovered a quick and dirty way to manipulate DB tables using .Net Windows forms. "Drag and Drop"
1. Drag a table from "Server Explorer" and automatically get a connection and dataAdapter object
2. You can use the dataadapter object to generate a typed datasets
3. Drop a Datagrid on the form and and set it's datasource to the dataset
4. Couple of buttons 4 lines of code (bit more if you want lookups as well)and you got yourself a pretty neat data entry form for that table.Average time to develop per form 5 minutes.Also the "Data Form Wizard" is pretty neat too, the only limitation being that it can't seem to handle multiple tables.Another useful trick is the Connection and DataAdapter wizards (when you drag connection and adapter objects onto your form) which allow you to generate completely customized objects.Looking forward to seeing what improvements are in store in Whidbey. -
Identity Crisis
I had been trying to connect my laptop to my home pc using a cross cable for so many days. Finally yesterday i decided to get it done no matter what. The problem was that despite all proper TCP/IP settings the two computers were not able to ping each other. I cleared my ARP cache, reinstalled the cards, changed subnets and IP addresses but to no avail. The green light was flashing on both cards and yet somehow they could not ping each other.Well after going through all the settings again and again and again, it finally hit me, both comps were named 'Sijin' , that might be causing the problem. So i renamed my home pc and after a reboot i had two way pinging wooooooot!!! :D :DMoral of the day : Give your babies seperate names. -
ADO.Net powertoys
Shawn Wildermuth aka ADO guy has a great book on ADO.Net called Pragmatic ADO.Net. It's a definite must read for anyone involved in ADO.Net programming, i have been working with ADO.Net for over a year and yet the book taught me so much, a definite buy. Also i recently used the ADO.Net powertoys to generate my typed datasets. That works great too. Basically the problem is that the methods that the normal typed dataset generator generates are not virtual so if you override the typed dataset then it only hides the base class methods. The ADO power tools has a Typed Dataset generator that defines the methods as virtual and offers other customization abilities. Other than that it has a Utility library of DB functions and a stored procedure generator.
-
Binding problems
I recently came across a problem in a GUI i had designed. The UI was data bound to an object, now when the user entered some text in a textbox, the change only got propogated back to the object when the user moved the focus away from the textbox. Not acceptable!! plus if the user happened to press the toolbar save button or use keyboard shortcuts, the value in the textbox was not saved back to the object.The problem is that by default, data is written to the source only when the validating event of the control fires.
The solution i used was to derive a custom textboxpublic class FastValidatingTextBox : TextBox
{
protected override void OnTextChanged(EventArgs e)
{
base.OnTextChanged (e);
Binding binding = this.DataBindings["Text"];
if(binding == null)
return;binding.BindingManagerBase.EndCurrentEdit();
}
}Using this class as soon the text changes the value gets committed back to the object. -
Great site for connection strings
This site has a great collection of connection strings for different scenarios and explanations for all the options that are used in connection strings. A definite bookmark if you are involved in DB programming.
-
These controls rock
Divil has updated his excellent UI controls for .Net. These controls totally blew me away, much more easy to use and way better looking than some commercial controls, and the prices are simply amazing. It's free for non-profit use. The controls include Menu and toolbars which can be docked to any side and have custom renderers, Docking window controls, outlook bar etc. This guy is really a guru of windows forms control development.
-
Interfaces can be both value and reference type
Yesterday someone posted a message on our user group asking if interfaces were reference or value type. Initially i thought reference type, but then i thought that since value types can implement interfaces too, it needs to be a value type as well.I wrote a small code snippet and used propertyGrid control to get visual results :)public interface ITest{}public class TestClass : ITest{}public struct TestStruct : ITest{}Here TestClass is a Ref type and TestStruct is a Value type.i wrote this code in the Form_load eventprivate void Form1_Load(object sender, System.EventArgs e){TestClass tc = new TestClass();ITest itc = (ITest)tc;propertyGrid1.SelectedObject = itc.GetType();TestStruct ts = new TestStruct();ITest its = (ITest)ts;propertyGrid2.SelectedObject = its.GetType();
}When i ran the propertyGrid showed that
itc.ValueType is 'false' and its.ValueType is 'true'.So interface has the same semantics as the type that implements the interface. -
My session for Delhi .Net User Group
I did session on advanced data binding in the Windows Forms. Basically i talked about how to setup two-way databinding in Windows Forms, implementing custom collection classes which implement IBindingList. Also i talked about implementations of IDataErrorInfo, IEditableObject etc. The session was well liked by everyone (I think :) ). Here is the source code for the demo.One thing i realized while making the presentation for this demo was that Data Binding is basically an implementation of the MVC architecture for .Net basically the framework is provding the interface for the controller part of the MVC architecture, the model is our object and the views are the forms.It was my first talk at a UG meeting and i really enjoyed it. I met the manager of our group Saurabh Verma(an MVP) again, it was Saurabh who had invited me to give the talk. Also i met a lot of core group members of our user group. It was nice to meet so many fellow developers. Being an independednt softwae developer i don't get to meet many of them. :) Looking forward to giving a presentation this month also. -
Fooled twice
I got fooled twice today :) :) Damn, should have been more alert.
-
Pop Quiz
public class MyBase
{
private string _foo = "Hello World"; -
How to Argue about Typing
Bruce Eckel has an excellent discussion on typing in programming languages.
-
Posts of the Day
Came across some really good reads today
-
Managing AssemblyVersion I
I have written a macro that autoincrements the build number of the AssemblyVersion based on the code that is available at http://blogs.biasecurities.com/jim/archive/2003/10/08/166.aspx
-
CVS .Net
It's been 2 weeks since i switched my SCC provider to CVSNT http://www.cvsnt.org . It has solved a lot of problems that i had before when i wanted to work on a new release but still maintain the old codeline for bug fixes and patches. Now using the branching capabilities of CVS i have two codelines life is much easier.
-
Decrypting IL strings and obfuscation in general
Some obfuscators encrypt the strings used in .Net assemblies. They typically change a line like
-
Good free components
Found some great components to integrate into my project.
-
CVSNT and VS.Net
Finally got decided to switch source control to CVSNT http://www.cvsnt.org , I have been using VSS for a long time now, but my project requires some advanced branching and release management. I evaluated Perforce, which looks like the best, although it is free for 2 users it costs 750$ per user for more, so I decided to give CVS a shot.
-
MSBuild on MSDN TV - Thoughts
So I watched the MSBuild Episode of MSDN TV http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20040122VSNETAK/manifest.xml
-
Joel on How to get your resume read
-
Bug or Feature
A strange thing happened today, I was implementing a small security package for my app. The project file was called Security and it created a Security.Dll file as output. I compiled and ran and BOOM no connection to the database!!! … I am thinking how can adding a new module totally unrelated lead to DB connectivity problems…So I do the usual checks, network connectivity, name resolution, I can connect thru enterprise manager, I can connect using SQL authentication. It seems that when I try to connect using SSPI I get the exception “Cannot initialize SSPI package”….Oh Boy…I am thinking corrupt memory, hard disk what could have happened, is my .Net installation corrupt?...So as any good windows user would do..i reboot…no help…problem persists. Its been an hour and I have only allocated 30 mins…someone suggests trying an earlier build….i think..well let’s give it a try..Viola it works…Light goes on…it has to be the security module, because that is the only change….i change the name of the project output to XXXSecurity.Dll and it works. Problem solved!! What a rush…Ahhh the joys of fixing problems.