How to disable the MySite and MyLinks in SharePoint and MOSS

I was struggling with this problem, but I did found that Michael Van Cleave had the solution.

 

Here’s the quote from his page:

Go to the Central Administration Web Page
Click on the link for Shared Services Administration
     –If you have more than one SSP, select the one that is running the MySites functionality
Under "User Profiles and My Sites" click Personalization Services Permissions

Select the group you want to limit the functionality for.  More than likely you will just have NTAuthority\Authenticated Users.

In the next screen you will see a list of checkboxes,
     –To disable MySites uncheck "Create Personal Site"
     –To disable MyLinks uncheck "Use Personal Features"

 

.NET naming Conventions

I found this great .NET Naming Convention guide from Josh Twist at The Joy Of Code.

Reading it, I decided to put it up here, since it is so great, and it’s the naming convention that I follow myself.

using System;

// Namespaces are PascalCased
namespace TheJoyOfCode.NamingConventions
{
    // Class names are PascalCased
    public class ExampleClass
    {
        // All public fields, including constants are PascalCased
        public static const string PiAsAString = "3.14";

        // All private fields are camelCased with an underscore [1]
        private readonly string _privateMember;

        // All protected members are PascalCased
        protected int ProtectedField = 12;

        // All internal members are PascalCased
        internal int InternalField = 13;

        // All private methods are PascalCased
        // *** NOTE – All parameters are camelCased
        private double Multiply(double valueA, double valueB)
        {
            // local variables (scoped within a method) are camelCased (no underscore)
            double result = valueA * valueB;
            return result;
        }

        // All private Properties are PascalCased
        // *** NOTE – Acronyms of 2 characters are UPPERCASED (e.g. UI, IO)
        private string UIElementName { get; }

        // All (public and private) properties are PascalCased
        // *** NOTE – Acronyms longer than 2 characters are PascalCased (e.g. Html, Xml)
        public int HtmlLength { get; set; }

        // All public methods are PascalCased
        // *** NOTE – All parameters are camelCased
        // *** NOTE – Abbreviations are not treated as Acronyms (so _Id_entification is Id, not ID).
        private void AlignObjectById(string id, Alignment alignment)
        {
            throw new NotImplementedException();
        }

        // Nested classes are PascalCased, even Private ones
        private class NestedClass : IDisposable
        {
            public void Dispose()
            {
                throw new NotImplementedException();
            }
        }
    }

    // Enums are PascalCased and not plural (unless marked [Flags] in which case the name should be plural)
    public enum Alignment
    {
        // Enum members are PascalCased
        Top,
        Bottom,
        Left,
        Right,
    }
}

// [1] – Note the underscore isn’t as recommended by StyleCop but since it applies only to private members, can be considered a matter of style and one that I personally use.

And, the last comment is also 100% on the spot;

…and as for #region blocks I do not use regions and I don’t negotiate with terrorists either.

How to fix the The type Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages does not implement IReportViewerMessages or could not be found error

The type Microsoft.SharePoint.Portal.Analytics.UI.ReportViewerMessages, Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c does not implement IReportViewerMessages or could not be found

 This nasty error message appeared when I published my Reporting Services local report to a custom Web Part.

I solved this be comment out the ReportViewerMessages line in appSettings section in the web.config

<appSettings>
<!–  <add key="ReportViewerMessages" value="Microsoft.SharePoint.Portal.Analytics…… /> –>

So far, I haven’t seen any issues by commenting out this entry.

 

How to fix the Failed to load expression host assembly error in a SharePoint custom solution

I was writing a custom Reporting Services local report , placed in a SharePoint Web Part, and got this error:

Failed to load expression host assembly. Details: Could not load file or assembly ‘expression_host_31f4d73d84764f4b9a7332f3673bdf0b, Version=10.8.30729.1, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)

This was fixed by setting the ExecuteReportInCurrentAppDomain property like so:

reportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);
 

 

How to fix the The type specified in the TypeName property of ObjectDataSource could not be found error in a SharePoint custom solution

The type specified in the TypeName property of ObjectDataSource could not be found error

I was coding away happily developing a custom Reporting Services report for a SharePoint Web Part. The Web Part hosts a local Reporting Services report (.rdlc) and it’s using an ObjectDataSource as the data source, and I was getting the type specified in the TypeName property of ObjectDataSource could not be found error.

So in my code I have a data class with a select method, so my constructor looks like this:

ObjectDataSource ds = new ObjectDataSource(“MyNameSpace.MyClass”, “GetObjects”);

However, when executing the report, I got this error:

The type specified in the TypeName property of ObjectDataSource ” could not be found

I had put my assembly in the SafeControl section in Web.config, and the assembly was in the GAC.

It turns out that it also needs to be referenced in the <assemlbies> list of the <compiliaton> section, like this:

<compilation batch=”false” debug=”false”>

<assemblies>

<add assembly=”MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789ABCDEF” />

</assemblies>

……

And now it worked.

How to debug Potentially excessive number of SPRequest objects error message

You may have seen this error message in your SharePoint log file.

“Potentially excessive number of SPRequest objects (10) currently unreleased on thread 5. Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed. This object will not be automatically disposed.”

Now this means that you have some (custom) code in your SharePoint installation that doesn’t dispose its memory allocation correctly. You have code that leak memory.

The error message in the log doesn’t say much on where this memory leak happens, which makes it a little bit difficult to trouble shoot. However, there is a way to tell SharePoint to tell you more on where this happens by also writing out the stack trace in the log file.

Open RegEdit and browse to the

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings

key. Edit the SPRequestStackTrace DWORD Entry and set it to 1.

You will now geta full stack trace whenever this error message appears, which makes it so much easier to trouble shoot.