Tuesday, September 15, 2015

Problem resolved - Remote debugging the windows service

Problem resolved - Remote debugging the windows service

The following error happens when trying to debug the windows service via remote debugger by visual studio.  You will find the breakpoints you set shows a cycle instead of substantial. It points the debugger issue. The application I need to debug is windows service with installation package. It finally works with copy directly the services application into the running folder instead of running installation package to setup. So, when the debugger runs with issue, try the direct from source to target and use copy instead of any other deployment or delivery way. It'll get you straight approaching.


The breakpoint will not currently be hit. No symbols have been loaded for this document




Thursday, February 26, 2015

SharePoint Error - You do not have appropriate permissions to create a new workbook in the specified location

Error that happening during generating a excel document in a SharePoint document library.


Error:

Cannot open file "You do not have appropriate permissions to create a new workbook in the specified location".
Correlation ID: c9fe6615-10bb-4542-b6de-9429258b99db
Date and Time: 2/26/2015 2:34:55 PM



02/26/2015 14:32:32.54 w3wp.exe (0x2EB0)                       0x2438 SharePoint Foundation         Runtime                       tkau Unexpected System.Runtime.InteropServices.COMException: Cannot open file "You do not have appropriate permissions to create a new workbook in the specified location".    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, String& pEtagNew, String& pContentTagNew)     at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, String& pEtagNew, String& pContentTagNew) 0b836823-fd28-4d03-944a-8a89b8e12892


Solution:

  1. add the permissions of excel service owner to the db
  2. remove the Excel Services Service application
  3. recreate the excel service application as well as the following proxy
  4. set the URI of excel document library in SharePoint  excel services application - Trusted File Locations.

Wednesday, February 25, 2015

Web service or WCF interface issue. The maximum nametable character count quota (16384) has been exceeded while reading XML data.

I have a proxy application that pass the same functionality outside of our corp network. It consumes internal web service (ASMX) through SSL required and opens through SharePoint web service port. It pops up the following error when I added some new functions which supposed to hit the default max limit. There a bunch solutions from internet and basically, most of them are targeting the configuration file (app.xml etc). As the proxy application is consuming the web service through encapsulated internal layer. So the solution that finally solved the issue is via the code. Here lists the proxy call function that specify the max limit value (2147483647).


Error: 

The maximum nametable character count quota (16384) has been exceeded while reading XML data. 



Solution function:


Public Shared Function SecureProxyCall(Of T)(targetUrl As String, programaticUserID As String, programaticPassword As String, domain As String) As T
        Dim binding As New BasicHttpBinding()
        Dim timeout As New TimeSpan(0, 20, 0)

        binding.MaxReceivedMessageSize = 2147483647
        binding.MaxBufferSize = 2147483647
        binding.ReaderQuotas.MaxStringContentLength = 2147483647
        binding.ReaderQuotas.MaxNameTableCharCount = 2147483647
        binding.SendTimeout = timeout
        binding.ReceiveTimeout = timeout

        Dim address As New EndpointAddress(targetUrl)
        Dim securedClient = Activator.CreateInstance(GetType(T), New Object() {binding, address})
        If String.IsNullOrEmpty(programaticUserID) Then
            'Force to anonymous
            binding.Security.Mode = BasicHttpSecurityMode.None
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None
        Else
            binding.Security.Mode = BasicHttpSecurityMode.Transport
            securedClient.ClientCredentials.Windows.ClientCredential = New Net.NetworkCredential(programaticUserID, programaticPassword, "nfm")
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows
        End If
        Return securedClient
    End Function

Thursday, February 19, 2015

SharePoint Error solution.

Error Message of SharePoint Log:


02/19/2015 09:41:32.81 w3wp.exe (0x0674)                       0x2468 SharePoint Foundation         Runtime                       tkau Unexpected System.MissingMethodException: Method not found: 'System.String Microsoft.Office.Server.UserProfiles.SynchronizationRunStatus.get_ConnectionName()'.    at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderSectionContents(HtmlTextWriter writer)     at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderWebPart(HtmlTextWriter writer)     at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter writer)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)     at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)     at System.Web.UI.HtmlControls.Html... 54625c4e-29c1-4b1c-bca1-117563688d20



Solution:


  1. Delete the old User Profile Service Application (SharePoint Central Administration).
  2. Delete the User Profile Sync Database (Keep the Profile DB and Social DB)
  3. Recreate User Profile Service Application (Specify new name of DBs)
  4. Set Administrators for User Profile Service Application (Add the farm account and user account in)
  5. Reboot the server.