I am in the process of getting up to speed with the new Visual Studio 2010 IDE and how it can be used to develop custom SharePoint 2010 solutions.
It’s so easy to do a “Hello World” Web part project now. These days, my Hello World projects typically involve opening up a database table and displaying records in a table. I was able to do this with minimal coding and got it up and running—a full blown Web part—in under 15 minutes!
I created a sample project that opens up the AdventureWorks database and displays employee records in a table:
Sample Visual Web Part Project using Adventure Works Database
The Web-part looks like the following when used inside SharePoint:
AdventureWorks Employees Web Part So far, I like it!Here are my first impressions:SharePoint project templates come out-of-the-box install of VS 2010. After installing VS 2010, the SharePoint project templates are ready for use. No need to do installations of VS-extensions.SharePoint Project Templates in Visual Studio 2010
- The Visual Web Part project cannot be deployed as a “sandboxed solution”. It has to be deployed as a farm solution.
- Project-debugging became a lot easier even with a full-blow farm-deployment. Press F5 in the VS 2010 IDE and Visual Studio will build, package, deploy, and activate your feature, and launch the debug-browser all in one click! When you’re done debugging, terminate Internet Explorer, Visual Studio will deactivate and retract the solution out of SharePoint.
- IIS-reset (for the target Web app) even for full-blown deployments when debugging is fast!
- Remember in VSeWSS 1.3 where you had to Google first how to specify the group the Web part appears in because it wasn’t so obvious? Well, it got easier in VS 2010! Now, the Elements.xml file has a place-holder for the Web-part group. All you have to do, is change it from “Custom” to whatever value you want it to be. It’s so visible now you can’t miss it.
Web-Part Group Place-Holder in Elements.xml File
- You can now add Web User Controls (ASCX files) into the project! As a matter of fact, the project template adds one ASCX file for you. This just made Web Part development a HECK of a lot easier! This is HUGE! Back in VS 2008 developing SharePoint 2007 Web parts, there were no designers available. If developers wanted to use ASCX files, they had to create regular ASP.NET Web apps, design the ASCX files there, write the code-behind, compile the project so the code-behind logic gets packaged with the ASCX files, deploy the ASCX files to UserControls folder within the SharePoint virtual Web app folder, deploy and enable Smart Part, add a Smart Part Web part to the SharePoint pages, then finally, hook-up the Smart Part to the ASCX files. Whew!!! Talk about LOTS of steps! In VS 2010, you don’t need Smart Part or that lengthy way to integrate ASCX file in SharePoint anymore. The challenge of “imagining” what your Web part will look like as you write your C# code is no more. The designer is built in to the Visual Web Part project. Leverage your ASP.NET skills to the max.
- Despite all the improvements, Web part development veterans should recognize familiar concepts and project files such as Elements.xml, .webpart file, strong-named key file, packages and features.
I have many ASP.NET developer friends who didn’t want to get into SharePoint development because:
- The Web part project wasn’t easy in SharePoint 2007. No designers, hard to design a visual element.
- ASP.NET developers got accustomed to easy debugging of their projects by simply pressing F5 key or the play button on the IDE toolbar. In 2007, ASP.NET developers thought deploying the app and then attaching to the w3wp.exe process (multiple manual steps, not one) was too cumbersome.
- It took forever to even debug the code because the SharePoint Web app always recycled on deployments.
If you are an ASP.NET developer contemplating if you should try SharePoint development, I highly recommend you try it NOW! SharePoint 2010 development feels like traditional ASP.NET development more than ever!
Posted by: Gabe Hilado in SharePoint
on June 11th, 2010
The hardest part in installing SharePoint 2010 on Windows 7 is the installation process itself and then configuring the Complete installation on a single-server of the SharePoint Config Database while using local accounts. Once the SharePoint Content DB and the SharePoint Admin Content Databases are created, you can now run psconfigui.exe, SharePoint Products Configuration Wizard.
When you run the PSCONFIGUI, since you already configured the SharePoint config database, will start-off at the following step of the Configuration Wizard. Notice that my database-server and database-name have already been pre-populated. Click Next.
SP Configuration Wizard - DB Selection
You get to specify additional information such as Authentication provider (choose NTLM, especially if you do not have domain controller in your network). You can also choose the port number where Central Admin will run.
SharePoint Configuration Wizard -Completing
Click Next until it runs the actual configuration of the Central Admin:
SP Configuration Wizard -Configuring
Once the Wizard is finished, run your Central Admin. If things were installed and configured correctly, you should be able to launch Central Admin:
1st Time in Central Admin 2010
Posted by: Gabe Hilado in SharePoint
on June 11th, 2010
Here are some of the other errors that I received while creating my SharePoint 2010 environment in Windows 7.
New-SPConfigurationDatabase: Could not load file or assembly ‘Microsoft.IdentityModel, Version 18.104.22.168. The Power Shell looks like the following when you’re running New-SPConfigurationDatabase to configure your SP database for the first time:
Could not load Microsoft.IdentityModel
The fix: Install Microsoft Identity Framework to address this problem.
New-SPConfigurationDatabase: The user does not exist or is not unique. You get to the point in the New-SPConfigurationDatabase command-let that asks you for the Farm Credentials. You didn’t fully qualify the username with the domain or computer name.
New-SPConfigurationDatabase - user does not exist
To fix this, simply make sure that the user account you are specifying for the Farm Credentials is fully-qualified with the domain-name or, if using local accounts, the computer name. Example: “macbookpro\gabe”.
New-SPConfigurationDatabase : Unknown error (0×80005000) At line: 1 char:20. + New-SPConfigurationDatabase <<<< + CategoryInfo : InvalidData
Unknown error when running New-SPConfigurationDatabase
This one frustrated the heck out of me. I configured my Macbook Pro already but I was installing SharePoint 2010 on another PC(has Intel Core i7 processor) in my office when I got this message. I thought the second pass-through would be easier. I already know I must follow every-step of the SharePoint 2010 on Windows 7 Development Workstation Guide. So, how can I possibly still mess it up?? You see, I’d get past the Passphrase question and it would process the command for a while and spit out the error message only at the very end. When I look at my SQL Server, the Config database is created but the “SharePoint Admin Content” database has not been created yet. I manually added the user-account to sysadmin group in SQL. I made the Windows login Local Admin. I serviced-pack the SQL instance at least twice. Still the InvalidData error message like above. I uninstalled SharePoint 2010 and re-installed it. When I uninstalled the entire SharePoint 2010 (remember, I was aiming for the “Complete” installation option), I reinstalled the second time just using the “Stand-Alone” install. I was thinking, this sucks, having to use SQL Express because I’m going for Stand-Alone install. I finished the Stand-Alone installation. I go ahead and try to configure it and the psconfigui.exe (SP Product Configuration Wizard) and bam—STILL an error! But this time, the error message was more helpful—it told me that IIS 6 is not installed. I look at my installed Windows 7 features and sure enough, IIS 6 wasn’t installed yet! I was pretty sure I ran everything on the checklist and I couldn’t have missed anything. Obviously, I missed something, and this something was the required Windows Features that must be turned on. So I installed II 6 feature on my Windows 7 and the Stand-Alone configuration worked and I saw the Central Admin. If you get this Unknown error (0×80005000), check your installed Windows Features and make sure you have IIS 6 Management Console installed.
IIS 6 Management Consol turned-on
Okay, after going through the stand-alone install and was made to enable IIS6, I uninstalled SharePoint 2010, again! Why did I uninstall it? Because it was installed using Stand-Alone install which uses SQL Server Express. This final time, I was determined to make the Complete installation (can add servers to farm) work. I installed the SharePoint 2010. I ran Power Shell and ran the New-SPConfigurationDatabase command-let and was able to create the configuration database. Yay!!!
SQL Server after successful New-SPConfigurationDatabase