.Net, ASP.Net, C#, VB.net, SQL Server, Xml, CSS, Design Patterns related tips, tricks, code snippets, articles, links, thoughts, etc. from Binu & Subi Thayamkery.
.net etc.
Binu Thayamkery is a seasoned software architect with more than 13 years of experience in developing enterprise grade connected systems using Microsoft Technologies. In his current position as a lead consultant-solution architect with Prudential Financial, he is working on architecture of next generation investment reporting framework using .net 3.5/WCF/AJAX, etc. He holds a Masters Degree in Computer Science from Colorado State University. Subi Thayamkery is an experienced software developer with more than 8 years of developing various application software systems ranging from workflow automation systems to compliance management tools. She currently works as a technology consultant for Prudential Financial where she helps develop a new system for corportate governance department. She holds an Electrical Engineering degree from New Jersey Institute of Technology.
Tuesday, July 29, 2008
Visual Studio 2008 Web Deployment Projects
Best feature you can get from this, "Create a single assembly" for all your files in your web project. It also offers a lot more customisation for MSBuild. For me, creation of single assembly for all the files became so important because of library management issues.
Scott Guthrie has couple of nice blog entries on this read it here
and here.
Cheers
Thursday, January 10, 2008
Visual Studio 2008 and VSS 2005
Once you apply the VSS update from this link you are all set to use VS.Net 2008 with VSS. (This update fixes a whole bunch of VSS issues as listed here.)
(Make sure that in Visual Sudio 2008, Tools > Options - Source Control, Microsoft Visual Sourcesafe is selected as current source control plug-in)
Cheers!
Welcome 2008!
We hope New Year brings new hope and cheer in everyone’s life.
We are glad to announce that we are back to blogging our .Net life. We had taken a nice long break from all these and now back to explore more in .Net world.
Cheers!
Thursday, May 03, 2007
What is *.VSHost.Exe?
Cheers!
Tuesday, May 16, 2006
Visual Studio.NET - Web Reference Static v/s Dynamic
In order to start using a web service, you should make a reference to this from Visual Studio,to acheive this,
- On your VS Solution Explorer, select your project, expand to References,Right click and click on Add Web References
- Type in URL of your web service and click on Go
- This will bring up your Web service's wsdl, you can change your web reference name to anything you want and click on Add Reference
Thats it, at this point, Visual Studio does all the work required (like creating your proxy class) and you are set to call your web service's web methods.
Now for some important and interesting observations!
The web reference you just created is a static reference, meaning it is always linked to the web service URL you just typed in. You can verify this by right clicking on your web reference to view the property sheet. You will notice that the URL Behavior is set to "static" with the Web Reference URL pointing to the URL you typed in. This is fine as long as you have only one environment (to TEST,QA,Stage, PRoduction....). But when you have to move your application through various environments in its life cycle, you will need to change this reference and rebuild the application. This leads us to the URL Behavior of "dynamic", when dynamic is set, your refrence.cs file (proxy) will include a property to read the URL from a Config File.
Code will look something like this...
public MyWebReference() {
string urlSetting = System.Configuration.ConfigurationSettings.AppSettings["MyWebRef"];
if ((urlSetting != null)) {
this.Url = string.Concat(urlSetting, "");
}
else {
this.Url = "http://myWS/myWS.asmx";
}
}
Depending on the type of Visual Studion Project your web service client is, it works slightly different,
- If your app is a web application and making the web reference from your application, this App Setting entry will go into its web.config file
- If your app is windows application, making a dynamic reference will create an app.config entry and when built will be part of your app.exe.config
- If you are referencing web service from a Class library project, the entry should be made to the client of that class library, if web project is using this class library then entry should be in web config or if its a win app using the class library, app setting entry will goto app.config!
Happy coding !!
Cheers!
Friday, March 03, 2006
ASP.Net - Some performance myths.
- C# code is faster than Visual Basic code - False! Rob says that there is a grain of truth in this mainly because VB.Net allows performance hindering actions like not explicitly declaring types.I think both should be comparable because all the .net languages are ultimately creatingt code targeting the framework CLR and CTS. If you follow good programming practices, VB.Net and C# should provide with same features and performance (pretty much!)
- Code-Behind is faster than Inlince code - False! Rob points out that sometimes it is advantageous to just change inline (or add inline) code because touching code behind means a Dll rebuild. If you ask me, I would say NO to inline code, haven't we had enough of spaghetti coding with all than classic ASP?
- Components are faster than Pages- False! True in classic ASP, no longer in ASP.Net, since page is also a class, it provides the same performance as components. Again from a modular design point of view, lets go with components!
Cheers!
Wednesday, March 01, 2006
Clear your web applications Cache
Being said that, I find sometimes a need to clear my web applications cache without affecting anything. In order to do that, this is the trick I have come up with (nothing genius here :)
I created a secure page (admin login required) with a "Clear All Cache" Button,
and here is what I do in that button click!
private void ClearCache_Click(object sender, System.EventArgs e)
{
IDictionaryEnumerator CacheEnum = Cache.GetEnumerator();
string cacheKey="";
while (CacheEnum.MoveNext())
{
cacheKey = Convert.ToString(CacheEnum.Key);
Cache.Remove(cacheKey);
}
}
Friday, January 06, 2006
VS.net project, accessing from Network Share !
If you place your VS.Net projects (Windows App) in a network share and try to work off that share, you might end up with an error message like this "The project location is not fully trusted by the .NET runtime". This message pops up when you try to open the project file. If you say Ok, to that "long" message and continue working you might end up with some security permissions issue when you try to debug. (In my case, I was trying to open a file using StremReader and it threw an Security Exception !)
In order to successfully run the projects, you will need to play around a bit with .Net configuration tool. Launch mscorcfg.msc (you should be able to find this under your current version of .Net Framework dir)
Under My Computer > Runtime Security Policy, you can either add a new code group and give "Full Trust" permission for the URL(File/Http) or you can use the adjust the security policy link, give Full Trust to Local Intranet.
Try one or the other and see what works for you !
Copyright 2008 Binu Thayamkery/Subi Thayamkery. All code snippets, samples provided AS-IS. Use at your own risk !