In The Mix

As a SharePoint architect I have the business behind me and the Developers and IT Pro on my shoulders.

BCS Model Receiver August 27, 2010

Filed under: BCS,SharePoint 2010 — fmuntean @ 2:11 pm
Tags:

BCS is now available in SharePoint 2010 at the Foundation level.
However seems that some people inside SharePoint team and Visual Studio team did not got the memo :)

The code to install the BCS model is only available inside a dll that is installed with the Standard/Enterprise edition of SharePoint 2010 Server.

I have just published a new project on CodePlex: http://bcsmodelreceiver.codeplex.com/ that will install the missing code as a Farm feature and will permit to install your BCS Model feature correctly on any platform. It is a Farm feature that will ease the pain of deploying BCS Models inside SharePoint 2010 especially the Foundation.

The code used in this project was actually published by Microsoft at: http://code.msdn.microsoft.com/BDCSPFoundation The only thing I have done is to put it together as a reusable feature so you do not have to cut and paste the code in each of the project.

Now, to use this feature, there is a small tweak that the developer has to do in Visual Studio, and that is to reference the BCS Model Feature Class from this project.

 
How To Install:
Install the BCSmodelReceiver.wsp into the SharePoint 2010 Farm.
The BCSModelReceiver Feature will be automatically activated and ready for use.
image
 
 How to use it:
Now in Visual studio you have to change the Feature Receiver used for your Model under the properties:
 
image
Replace the existing value for the Feature Receiver property with: MFD.SharePoint.BDCModelReceiver.ImportModelReceiver, MFD.BCSModelReceiver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e1e7a9e7f1c01c11
Now just build the WSP and deploy it in the FARM. It will automatically use this event receiver.
Plus optionally on the feature settings you can make your Model Feature depended on the BCSReceiver Feature ID=c1b3a659-a86e-4353-aad3-efe46cbbb4eb
NOTE: Once you  use this receiver you will have to deploy this feature in the Farm even if you are using SharePoint 2010 Standard/Enterprise.
 

Serialization inside SandBox Solutions June 29, 2010

Filed under: SharePoint 2010 — fmuntean @ 4:27 pm
Tags:

When creating a Web Part in SharePoint 2010 that will store configuration/data inside the SP Hierarchical Store at the SPWeb  level, using automatic serialization of an object, I got into the following error: System.Runtime.Serialization.SerializationException was unhandled Message=Unable to find assembly ‘MFD.SandBoxWebPart, Version=1.0.0.0, Culture=neutral ….’

Now to explain in more details the problem and how I choose to resolve it.

The configuration class is nothing else than a DTO class containing the configuration items as public properties and the [Serializable] attribute and be as simple as this example:

  1. [Serializable]
  2. public class MyConfig
  3. {
  4.     public string Config1 { get; set; }
  5.     public long Config2 { get; set; }
  6. }

I got the previous error when adding an instance of this class into the SPWeb Properties as in the following example (the exception gets thrown at line 5):

  1. SPWeb web = SPContext.Current.Web;
  2. {
  3.     var config = new MyConfig()
  4.                     {Config1=“Value1″,Config2=123};
  5.     web.AddProperty(“Key”,config);
  6. }

Now there is nothing wrong with accessing the SPWeb properties inside the Sandbox solutions as the following code will work just fine:

web.AddProperty(“Key”,”Value”);

The problem is that the serialization mechanism inside .NET requires to load the assembly for reflection. The SandBox assembly can’t be found because it is not saved in the GAC or any of the SharePoint folders as it only resides in memory and on the Content Database.

A work around for this to create your own serialization to xml/string using custom methods that will save/restore your data using one of the .NET classes (that can be serialized because they live in GAC).

An example of new MyConfig class will look like this:

  1. [Serializable]
  2. public class MyConfig
  3. {
  4.     public string Config1 { get; set; }
  5.     public long Config2 { get; set; }
  6.     public static MyConfig FromXML(string xml)
  7.     {
  8.         XElement doc = XElement.Parse(xml);
  9.         return new MyConfig()
  10.         {
  11.             Config1= doc.Element(“Config1″).Value,
  12.             Config2 = long.Parse(doc.Element(“Config2″).Value)
  13.         };
  14.     }
  15.      public string ToXml()
  16.         {
  17.             XElement xml = new XElement(“MyConfig”,
  18.                 new XElement(“Config1″,this.Config1),
  19.                 new XElement(“Config2″,this.Config2));
  20.             return xml.ToString();
  21.         }
  22. }

Now all you have to do to store the config in SPWeb properties is to:

  1. SPWeb web = SPContext.Current.Web;
  2. {
  3.     var config = new MyConfig()
  4.                     {Config1=“Value1″,Config2=123};
  5.     web.AddProperty(“Key”,config.ToXML());
  6. }
 

SharePoint Saturday Boston 2010 February 27, 2010

Filed under: Conference,Presentations,SharePoint 2010 — fmuntean @ 1:55 pm

Thanks everybody for attending my session on SharePoint 2010.

I have uploaded the presentation on Slide Share for you to have, including the speaker notes. Feel free to drop me a line if you have any questions.

As you learn more about SharePoint 2010 you will see that there is a lot that I have to let out due to the time allowed for the presentation. There was no rule on that so if you want more talks or info on a specific feature drop me a line.

I will go over the evaluations once I get them back from the organizers and will update this post or add more to answer all your questions as promised.

 

SharePoint Saturday Boston Feb 2010 February 19, 2010

Filed under: Conference,Presentations,SharePoint 2010 — fmuntean @ 4:31 pm

The clock is ticking, the event is closing and preparations are undergoing to make this event one of the best for SharePoint enthusiasts.

Join us on February 27, 2010 for a day of fun learning with almost 30 presenters multiple tracks and many hours to learn about SharePoint.

If you have not register for the event here.

To help with choosing the correct room for presentations so we don’t cram 300 people in a small room please Respond to this Survey, and I hope to see you for my presentation “Introducing SharePoint 2010 to Administrators”.

Now I am going back to prepare for the event. See you there.

SharePointSatBoston

 

Sandbox Solutions issue in SharePoint 2010 Beta February 2, 2010

Filed under: SharePoint 2010 — fmuntean @ 10:23 am
Tags:

For those who start building sandboxed solutions in SharePoint 2010 beta and have trouble seeing their sandboxed solution web part on the page,or deployment errors there is a known bug in there that can be corrected by applying the following Power Shell script witch fix the ACL for the sandboxed code:

 

#Fix SharePoint Sandboxed Solutions Bug – Web Part Not Visible
$acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
$person = [System.Security.Principal.NTAccount]"Users"
$access = [System.Security.AccessControl.RegistryRights]::FullControl
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [System.Security.AccessControl.PropagationFlags]::None
$type = [System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
$acl.AddAccessRule($rule)
Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl

 

SharePoint 2010 – Technical diagrams December 14, 2009

Filed under: SharePoint 2010 — fmuntean @ 7:23 pm

Up on TechNet Microsoft have released a lot of diagrams based on the Beta 2 version of SharePoint 2010.

Many of these resources are visual representations of recommended solutions. They include poster-sized documents available in formats including Microsoft Office Visio 2007 files (.vsd), PDF files, and XPS files.

If you want a poster size diagram from areas like: Services, Topologies, Hosting Environments, Search Technologies, Business Connectivity Services Model, Content Deployment, Upgrade Planning, and business intelligence in SharePoint Server 2010 then get them all from here.

 

External Lists Limitations in SP2010 December 13, 2009

Filed under: SharePoint 2010 — fmuntean @ 8:33 pm
Tags: ,

Currently SharePoint 2010 is in Beta 2 phase and I am investigation the new possibilities given by the new External List feature.

During the investigation found few limitation that I will document them here:

  • RSS feeds are not enabled
  • InfoPath Forms can be generated but if try to customize them you get in a lot of limitations including not supporting other data connections.
    image
  • Creating Access View not working
  • Data Sheet View is disabled
  • Export To Excel is disabled
  • Adding extra columns not from the external content Type are not allowed
  • Ratings and Workflow are not allowed.
  • Trying to change “Information management policy settings” gives error.

SharePoint is currently only in the beta phase but It seems again that external list have a lot of limitations and I don’t know how much of them will be removed by RTM.

Even if Microsoft was trying to make the External Lists to be as transparent as possible for the End User we’ll need to be careful when recommending and use this list because of the existing limitations.

I have hoped that when Microsoft have designed this External List to just decoupled the data storage and data access layer from the rest of the SPList type.

 

Installing SharePoint 2010 on Windows 7 November 26, 2009

Filed under: SharePoint 2010 — fmuntean @ 1:03 pm

Installing SharePoint 2010 on Windows 2008 is a breeze with the new included Farm Setup Wizard, however installing it under Windows 7 is another story.

I approached SharePoint 2010 the old way, try and see, planning to write a post on how to install SharePoint 2010 on Windows 7, and then realized that Microsoft have promised that with this version the documentation will be here so I tried the MSDN and there it is, a step by step instruction available here: http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

The following steps are based on the public beta for SharePoint 2010. So in short what you need to do is:

  1. Extract the SharePoint files into a folder.
  2. Modify the config.xml to be able to install it on Windows 7 by including the <Setting Id="AllowWindowsClientInstall" Value="True"/> tag.
  3. Install prerequisites:
  4. Enable all the necessary windows features using this script.
  5. Reboot your computer (this step is very important don’t skip it otherwise you might get errors when running the configuration wizard).
  6. Install SharePoint 2010 from the extracted folder.
  7. When you are prompted to run the Configuration Wizard, don’t.
  8. Install SQL Server 2008 KB 970315 x64.
  9. Install FIX FOR: WCF: SharePoint Shared Services Roll-up
  10. Now you can run the Configuration Wizard.
  11. Install Visual Studio 2010 Beta 2 Professional.
  12. Download and install the Microsoft SharePoint 2010 SDK.

If you plan to install the Office Web Application again you will need to extract the files then modify the config.xml to allow the Windows 7 installation by including <Setting Id="AllowWindowsClientInstall" Value="True"/> tag.

 

Developer Dashboard

Filed under: SharePoint 2010 — fmuntean @ 12:46 am

A new developer and QA feature available in SharePoint 2010

You can easily turn on the developer dashboard, a way for the developer to check the performance of the page, by running a simple stsadm command (yes I am still using it):

There are 3 states: on, off or ondemand and here’s the syntax:

stsadm -o setproperty -pn developer-dashboard -pv ondemand

stsadm -o setproperty -pn developer-dashboard -pv on

stsadm -o setproperty -pn developer-dashboard -pv off

 

Off = Always off, usually used in production.

On = Always On, for development purposes, however I would say that is annoying to see it on all the pages and not recommended for production.

OnDemand = The user has the possibility to turn it on or off as needed using the small icon to the upper right hand corner of the page; you click the icon to toggle the dashboard on and off.

Developers will be able to write performance information into this Dashboard using the new SPMonitoredScope class

For more great info about this new feature you can read this post: http://blogs.technet.com/speschka/archive/2009/10/28/using-the-developer-dashboard-in-sharepoint-2010.aspx

The OnDemand option gives you the best flexibility and is safe to be used in production during the investigation process.

[Update] If you get “Access Denied!” error on Windows 7 then just run the Command Prompt as Administrator and will succeed.

 

SharePoint 2010 Installation options November 25, 2009

Filed under: SharePoint 2010 — fmuntean @ 10:08 pm

Starting with the new release of SharePoint 2010 The Developer has more options on how to run it. And yes I said “The Developer” as SharePoint on Windows 7 will not be supported as a production platform.

  Physical Virtual
Windows 7 x64    
Windows 2008 R2 x64    

So now you will end up in one of this boxes. I will describe what each means for you based on my own experience in this post.

I have choose only Windows 7 and Windows 2008 R2 because of few things:

  • If you still have Vista then upgrade to Windows 7 now.
  • Windows 2008 R2 has a better Hyper-V.
  • Both have support for boot to VHD

Now let me describe my current setup:

I have a laptop with multi boot using Boot to VHD with the following operating systems:

  • Windows 7 with SharePoint 2010 for development
  • Windows 2008 R2 with Hyper-V; having following VMs inside:
  • Windows 7 and all the software necessary for office work (no Visual Studio or SharePoint here)
  • One or more Windows 2008 R2 with SharePoint for development and testing purposes.

This setup lets me have the full flexibility on what am I running and when. However it comes with a price. Windows 2008 does not have Hibernate or anything like this so every day I have to shut it down and power it up in the morning. Another issue that I am experiencing is that the wireless driver stops working from time to time and a reboot is needed to fix it.

Booting inside Windows 7 environment requires me to mix the SharePoint development with the office work and application thus making that more unstable at times. However the hibernate and suspend mode are working here.

Installing Windows 2008 and SharePoint on my laptop directly does not give me much benefit as again I will need to mix the office and development together.

Currently I am trying all the four possibilities for SharePoint 2010 and on a later post I will let you know which one I choose to go with.

One advantage of using Hyper-V is that I can choose how much memory to allocate to each of my VMs giving me an easy way to test for how much memory I really need when working with SharePoint.

Let me know which approach do you prefer yourself and why.

 

 
Follow

Get every new post delivered to your Inbox.