Wednesday, May 12, 2010

Tune In Today For Official SharePoint Office launch

Tune In Today For Official SharePoint Office launch webcasts!! http://twurl.nl/gcb62p #join2010 #sharepoint PLs RT!

Wednesday, May 05, 2010

Debugging in VS 2008

When your project is ready for debugging, make sure you do not change ANYTHING in your code after you have built the project. Follow the steps IN ORDER:

Place a breakpoint in your code
Rebuild your project
Drop the dll into the GAC
Do an IISRESET
Refresh the web/sharepoint page (F5)
Attach with w3wp.exe process. (In visual studio, go to “Debug –> Attach to Process –> w3wp.exe –> Attach”)
This will put your project in debugging mode. Remember to do these steps in order. Some of your breakpoints may not be active generating a message “Symbols not loaded”. That’s because you may be working with an event handler and it is not fired as yet (so no worries). As soon as the event handler fires, the symbols will be acitvated automatically. For instance, if it is an ItemAdded event handler, go add a document to the document library and the breakpoints will be hit as they are executed.

If the breakpoints are not hit, that means your code is not executed, that can happen if you didnt perform the actions that will execute the code marked with breakpoints, e.g. in case of an ItemAdded event handler you didnt add any item to the document library.

It could also be the case that you made changes to your code, if so, repeat the above process in order.

When the breakpoints are hit, press F5 to move forward from one breakpoint to another in order of execution (Visual Studio 2008).

When your code is attached to a process do NOT hit the stop button, this will terminate the running process and terminate the SharePoint Web application.

Always click “Debug –> Detach All”. In this way Visual Studio will leave the process without taking the sharepoint application down with it.

Item Level Permission in a document Library

Here is how you can set item level permissions for a document library/list in sharepoint.





01 public string ItemLevelPermissions(string SiteAddress)

02

03 {

04

05 string ReturnResult = "";

06

07 try

08

09 {

10 SPSecurity.RunWithElevatedPrivileges(delegate()

11 {

12 using (SPSite WebApp = new SPSite(SiteAddressHere))

13 {

14

15 using (SPWeb Site = WebApp.OpenWeb())

16 {

17

18 SPList list = Site.Lists["MyDocLib"];

19

20 SPListItem item = list.Items[0];

21

22 SPRoleDefinition RoleDefinition = Site.RoleDefinitions.GetByType(SPRoleType.Contributor);

23

24 SPRoleAssignment RoleAssignment = new SPRoleAssignment("\\", "EmailAddressHere", "GiveNameHere", "GiveNotesHere");

25

26 RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);

27

28 if(!item.HasUniqueRoleAssignments)

29

30 {

31

32 item.BreakRoleInheritance(true);

33

34 }

35

36 item.RoleAssignments.Add(RoleAssignment);

37

38 item.Update();

39

40 }

41 }

42 });

43 }

44 catch (Exception ex)

45

46 {

47

48 ReturnResult += "Sorry the permissions could not be set for the item due to the following exception: " + ex.Message;

49

50 }

51

52 return ReturnResult;

53 }

Monday, May 03, 2010

Visual Studio 2010 Links

Here is the list of links that can help regarding Visual Studio 2010 new features:
What's New
Visual Studio Product Group Blogs
Visual Studio ALM Rangers 2010 readiness materials
10-4 video shows
Upgrading from TFS 2005/2008 to TFS 2010
Team System 2010 Overview
Team Foundation Server 2010 Key Concepts
TFS 2010 Project Management
TFS 2010 Work Item Tracking
Debugging and Profiling features in Visual Studio 2010
Write Faster Code with VS 2010 Profiler
Multi-Tier Performance Analysis
Visual Studio 2010 Beta 1: Parallel Performance Tools Overview
A Branching and Merging Primer
New features to understand branching/merging
Favorite VS2010 Features: Dependency Graphs and DGML

Web and Load Tests
Web and Load Test features in Visual Studio 2010
Introducing the Microsoft Visual Studio Load Test Virtual User Pack 2010
Using The Virtual User Activity Chart to Understand the VS Load Engine
VSTS 2010 Feature: Load test virtual user activity visualization

Lab Management
What is new for Visual Studio Lab Management 2010 RC
Getting started with Lab Management (Part 1)
Getting started with Lab Management (Part 2)
Getting started with Lab Management (Part 3)
Getting started with Lab Management (Part 4)
Enable Lab Management features for existing Team Projects in Beta2
Customization of End to End (E2E) Workflow of Visual Studio Lab Management 2010 Beta2

Test Professional
What’s new in Test and Lab Management in VS 2010 Beta 2
What’s New for Testing Tools in the RC?
Elevating the Role of the Tester with Visual Studio 2010
Resources for Visual Studio 2010 Test Tools
VS2010 demos for testing tools – MTLM, CUIT and related features
Test planning using Camano
Remote Execution and Data Collection
Diagnostic Data Adapters: Changing how Developers and Testers work together (Part 1 of 2 - The Test Impact Collector)
Diagnostic Data Adapters: Changing how Developers and Testers work together (Part 2 of 2 - The Diagnostic Trace Collector)
The Microsoft Test Runner – innovation for the Generalist Tester
Platform Support for Coded UI Test (and Fast Forward feature of Test Runner)
Coded UI Test
Test Impact Walk-through

TFS API
Introducing the TfsConnection, TfsConfigurationServer and TfsTeamProjectCollection Classes
Labels: