.net, c#, java,sql, OOAD and more mad memory dumps...
These days I'm working on a CMS solution and I had all my list definitions and list instances in one feature, so everything was working fine. But its not ideal as each time I change the list definitions I have to de-activate and re-activate the whole feature. And each time I do that the default data I have defined in list definitions are duplicated. So I created another feature for list instances but its giving the following error when trying to activate. "GetUserListSchema(): Failed to get the list ......
Going over all the w3wp processes in task manager is frustrating if you wanna do this frequently :). So here it is.
taskkill /F /IM w3wp.exe /T
Works in the command line and PowerShell as well.
/// <summary> /// Add Permission Level to a Sharepoint user group collection /// </summary> /// <param name="spWeb">The sp web.</param> /// <param name="permissionName">Name of the permission.</param> /// <param name="groupCollection">The group collection.</param> public static void AddPermissionsToGroupCollec... spWeb, string permissionName, string[] groupCollection) { SPSecurity.RunWithElevatedP... { try { //Allow updating of ......
public static List<string> GetChoiceFieldValues(string listName,string fieldName, string siteCollection, string webSite) { List<string> fieldList; SPSite spSite = null; SPWeb spWeb = null; try { if (siteCollection != null) spSite = new SPSite(siteCollection); else spSite = SPContext.Current.Site; if (webSite != null) spWeb = spSite.OpenWeb(webSite); else spWeb = spSite.OpenWeb(); SPList spList = spWeb.Lists[listName]; SPFieldChoice field = (SPFieldChoice)spList.Field... fieldList ......
Today I had to work on a project which uses VS2008 and SQL Server 2008. I haven't used SQL2008 but had used VS2008 a little bit. When I tried to install SQL2008 (Developer edition) got this strange error which says "Microsoft .NET Framework 3.5 installation has failed. SQL 2008 Setup requires .NET 3.5 to be installed." Strange thing is I had installed .NET 3.5 in the VPC upfront. Actually you are installing .NET 3.5 when you install VS2008 right? Anyway I tried to resolve this using, 1. Uninstall ......
/// <summary> /// Add a user to a Sharepoint group /// </summary> /// <param name="userLoginName">Login name of the user to add</param> /// <param name="userGroupName">Group name to add</param> private void AddUserToAGroup(string userLoginName, string userGroupName) { //Executes this method with Full Control rights even if the user does not otherwise have Full Control SPSecurity.RunWithElevatedP... { //Don't use context to create the spSite object ......
STSDEV is a simple tool for SharePoint developers. It helps you to create SharePoint projects (with solutions precisely) and deploy templates and components into the SharePoint 2007 platform. http://www.codeplex.com/stsdev This tool creates project and solution in same name and in the same folder. We all know we never put the solution and project files in the same folder and never use same name for the solution and the project. Unfortunately we didn’t find a way of changing those and use the tool ......
One of the main things you should consider if you believe in good coding is error or exception handling. When it come to programming languages, now all popular object oriented languages have try, catch method to handle an exception. We can put our code (which might gives errors or exceptions) inside the try block and error handling code in the catch block. This has become the de-facto of error or exception handling now. But when it comes to T-SQL we hadn’t got that luxury. Error handling in T-SQL ......
Visual WebGui is the .net answer for GWT (Google Web Toolkit). But it’s seems more powerful than GWT even though it’s not coming from Microsoft and yet it’s open source. Still I hadn’t got time to put my hands on deeply but you can feel it by just browsing their web site and checking the features and comparing those with GWT. Not like GWT, in Visual WebGui you can use existing windows controls to create your UI. Major advantage of Visual WebGui over GWT is we can deploy Visual WebGui applications ......
Well guys... If you have read my previous blog post about Guice and you are using only .net technologies you might got little bit worried of that why you can’t use such a nice framework. Don’t worry, there is a project going on at Google called Titan that inspired by Guice. It’s still in the beta stage though. It’s a pre-release version and they don’t recommend it using in mission critical applications. Titan is a new take on inversion of control for .NET 2.0 applications, inspired largely by Bob ......
There is a good audio talk show in .net Rocks with Mark Pollack who founded Spring.Net. Particularly this show would be more useful if you are not aware of the potential of Spring.Net. BTW Spring.Net has announced the release of Spring.NET 1.1 M1 (Milestone 1). New features and improvements in the release are below. * NUnit Integration: Aids in writing integration tests. Configuration of test cases via dependency injection and automatic transaction rollback * NHibernate 1.0/1.2 Integration: Simplify ......
It’s seems to me that lot of developers still don’t know there is a very easy way to create a temp SSL for your local server for testing your web application. You don’t have to obtain a trial SSL’s from third party venders or installing and using certificate service. All you have to do is just use selfssl.exe which coming with IIS6 resource kit . Even though that resource kit is for IIS6 you can use it (selfssl.exe) with XP (IIS 5.1). I think it’s also compatible with Win2k also (IIS 5.0). BTW Today ......
If you are coming from vs2k3 background you might know how easy to get the XML view of a Typed DataSet. But unfortunately in vs2k5 they have removed that convenient XML view tab. So how we gonna see the xml of the typed dataset. One of my friends asked me today and my instance answer was use other editor to get that facility. But after doing some research I found that we can get into xml view by right clicking the XSD file in the solution explorer and picking “open with”. Not only the xml view but ......
Can you model Aggregations in Class Designer? No, you can't. The problem is that Aggregations and Compositions cannot be distinguished from regular associations in code because the .NET languages (apart from Visual C++ perhaps) do not distinguish members held "by reference" (regular association) from those held "by value" (aggregation or composition). Even if you could model aggregation in Class Designer, the information would be lost when you re-visualized the code, for example by dragging the classes ......
Seems like more people are concerning on the WinFX renaming to .NET 3.0. There is a petition in the web written by Rei Miyasaka. WinFX was renamed to .NET 3.0. This decision was made without any community feedback, which is uncharacteristic of Microsoft's recent openness to community input. Not only is .NET 3.0 a misnomer, it throws a wrench in the .NET Framework, likely jamming future versions. It is also a severe inconvenience to developers, especially newcomers. We ask that this short-sighted ......
We all know that .NET 3.0 is coming. But majority of the community are still catching things in 2.0. But don’t worry; there is no framework change in 3.0 from 2.0 but some additional features (libraries) ships with. So how come it’s a main version change ha? I think Microsoft had to make it 2.1 or sth but not going for 3.0. Actually I’m not the only one thinks like that. Check this out and let me know what do you think ......
Have you ever wondered why instance methods in java are virtual by default and in C# not? In C# to make a method virtual you have to explicitly do it right? Why is that? I think better to ask from creator of the C# language. :) So this is what Anders Hejlsberg says: There are several reasons. One is performance. We can observe that as people write code in Java, they forget to mark their methods final. Therefore, those methods are virtual. Because they're virtual, they don't perform as well. There's ......
last week my project manager asked me to do training for our colleagues on Unit testing with Nunit. So I thought better to use VS 2005 with new inbuilt unit testing capabilities. I had installed VS Professional edition and I knew that Unit testing is not coming with that edition. I knew that we have VS team edition for architects also and I installed it. But after I installed it I couldn’t found built-in unit testing there. I thought this may be an installation problem or I haven’t to configure VS ......
“Yesterday it still worked and now it doesn't anymore, what did happen?" "Why does it work on this computer and not on another one?" I bet you have heard this before from your colleagues or may be you have yelled like this. :) Anyway read this nice document from Hans De Smaele and try to reduce no of times you will hear this. But I’m death sure it wouldn’t be eliminated. :) http://www.microsoft.com/be... ......
Last week I got some emails from colleagues regarding “C# Coding Standards”. Lance Hunt’s “C# Coding Standards for .NET” caught my eye and especially the part about Object Model Design. Always prefer delegation over inheritance. Avoid “Premature Generalization”. Create abstractions only when the intent is understood. Do the simplest thing that works, then refactor as time permits. Always make object-behavior transparent to API consumers. Always separate presentation ......
Guidance Explorer is a tool to find and use relevant patterns & practices guidance. Guidance Explorer installs with a guidance library including performance and security topics for .NET and ASP.NET applications. The guidance library contains checklists and guidelines covering design, implementation and deployment topics. The tool and the library will evolve over time to include additional types of guidance. Usage Scenarios * Improve the security and performance of your application with guidelines ......