Monday, September 30, 2013

SP 2010 Publishing Sites Without Workflows

We just did the upgrade on an old 2007 site to get it up to 2010.
We had a pages library which required user's to go through the approval
process just to publish!  Egads lots of pain for our users. 

Thanks to the grumpy guru at Publishing Sites Without Workflows

Solution:
Navigate to the Pages library (View all site content for example). Click on the Library tab then Library Settings. Under General settings, click on Versioning settings. For “Require content approval for submitted items?” select the No radio button. That’s it!

Wednesday, September 18, 2013

Visual Studio 2010 Maint: Path to installation not available.

This error seems to bite a lot of devs.  I have a box with full SQL 2008 and VS 2010 installed.  Each time I tried to add in a new feature to the existing install it fails.  I dug around the temp dir and looked at the log.

In Error log:

VS70pgui: ***ERRORLOG EVENT*** : Unable to retrieve the install directory for Microsoft Visual Studio Performance Collection Tools for v4.0 in COptionsPage::IsGoodAllComponenentsPath


Not sure what was causing this until I stumbled upon this post http://edeevans.wordpress.com/category/development-tipstricks/

Problem:
I believe this may be due to having installed SQL Server 2012 Developer Edition which uses a stand-alone install of Visual Studio 2010. I say this because while solving the issue by uninstalling SP1, I was prompted for the MSI for vs_setup.msi. I was puzzled by this until I looked closer at the prompt which mentioned Stand Alone and that jogged my memory of the SQL install. The SQL Management Studio will use a stand-alone install of the previous version of Visual Studio. So SQL 2010 uses Visual Studio 2008 and SQL 2012 uses Visual Studio 2010. At any rate, I had to mount the ISO for SQL Server 2012 and point it at the proper location to complete the uninstall of SP1.

Solution:
Remove SP 1 since I can't remove SQL Server.  This resolved the issue.  Then I reapplied SP1.

Tuesday, September 17, 2013

IIS application can't connect to database with account DOMAIN\MachineName$

Problem:
Have a UAT box which runs Win 2008 R2, IIS 7.5.  Have anonymous authentication disabled and both ASP.Net impersonation and windows authentication enabled.  Application is connecting to remove sql server which is using windows only authentication and has ssl enabled.  We have created a forest level service account to connect between IIS and SQL.  This should work but keep getting access errors on SQL saying that account DOMAIN\MachineName$ does not have access to sql server.  I really was not sure what was happening since I have set up impersonation and knew that the service account was correct and had dbo roles in the database.  The issue turned out to be the application pool identity on IIS for this application.  It was set to use the default local network account on IIS.  This has no access to the SQL box.  I set the app pool identity to the service account and restarted iis.  It now connects and passes through the sql requests without error. 


Solution:
1.) in IIS : set up impersonation in IIS application.  Disable anonymous auth. Require windows logon. Set the impersonation account to use the service account
2.) in SQL: add required dbo roles to the service account
3.) Check the IIS app pool identity
The issue turned out to be the application pool identity on IIS for this application.

Monday, September 16, 2013

WCF service hosted in IIS 7 returning error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service"

This seems to be a pretty common error.  See the below discussion on msdn,
http://social.msdn.microsoft.com/Forums/vstudio/en-US/9e60fd61-aa84-453a-b340-8e1334d7acc9/wcf-service-hosted-in-iis-7-returning-error-security-settings-for-this-service-require-anonymous.  There was a lot of talk about setting IIS to anonymous and letting it go at that.  This would ignore the whole binding process for WCF.

My particular problem was that my IIS site hosted was locked down to Windows authentication due to the application requirements.  We are communicating with a database via this application and can not allow anonymous access due to security restrictions.  We still needed to run a WCF service to do the actual communication with the database to our mid tier.  This can be done but you need to set the binding for the service correctly.

Solution:

You need to define the security for the WCF service in the configuration bindings

Sample:

<system.serviceModel>
  <services>
       <service name = "WorkflowService" behaviorConfiguration="serviceBehavior">
            <host>
               <baseAddresses> <add baseAddress=https://yourserver /> </baseAddresses>
            </host>
         <endpoint name = "BasicHttpEndpoint"
                           binding = "basicHttpBinding"
                           bindingConfiguration = "WorkflowBinding"
                           contract = "IWorkflowService"
                           behaviorConfiguration="WorkflowEndpointBehavior">
         </endpoint>
       </service>
  </services>

This sample defines my service which will need to be "anonymous" to invoke the service on an SSL windows IIS site.  The key is in the definition of bindingConfiguration.  This sample service would need the binding defined so:

<bindings>
      <BasicHttpBinding>
             <binding name="WorkflowBinding" receiveTimeout="00:30:00" sendTimeout="00:30:00"
               maxReceivedMessageSize="2147483647"/>
              <security mode="Transport">
                          <transport clientCredentialType="Windows"
                            proxyCredentialType="UserName"
                            algorithmSuite="Default"/>
              </security>
            </binding>
      </BasicHttpBinding>
</bindings>


Set the security mode to transport and specify the credentialtype as windows.  This is the key to getting past this error. 

clientCredentialType

clientCredentialType
  • Specifies the type of credential to be used when performing client authentication using HTTP authentication. The default is None. This attribute is of type HttpClientCredentialType.
proxyCredentialType
  • Specifies the type of credential to be used when performing client authentication from within a domain using a proxy over HTTP. This attribute is applicable only when the mode attribute of the parent security element is Transport or TransportCredentialsOnly. This attribute is of type HttpProxyCredentialType.
Source:
http://msdn.microsoft.com/en-us/library/ms731334(v=vs.100).aspx


security mode

Member nameDescription
Supported by Portable Class LibraryNoneThe SOAP message is not secured during transfer. This is the default behavior.
Supported by Portable Class LibraryTransportSecurity is provided using HTTPS. The service must be configured with SSL certificates. The SOAP message is protected as a whole using HTTPS. The service is authenticated by the client using the service’s SSL certificate. The client authentication is controlled through the ClientCredentialType.
MessageSecurity is provided using SOAP message security. For the BasicHttpBinding, the system requires that the server certificate be provided to the client separately. The valid client credential types for this binding are UserName and Certificate.
Supported by Portable Class LibraryTransportWithMessageCredentialIntegrity, confidentiality and server authentication are provided by HTTPS. The service must be configured with a certificate. Client authentication is provided by means of SOAP message security. This mode is applicable when the user is authenticating with a UserName or Certificate credential and there is an existing HTTPS deployment for securing message transfer.
Supported by Portable Class LibraryTransportCredentialOnlyThis mode does not provide message integrity and confidentiality. It provides only HTTP-based client authentication. Use this mode with caution. It should be used in environments where the transfer security is being provided by other means (such as IPSec) and only client authentication is provided by the infrastructure.

source:http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpsecuritymode(v=vs.100).aspx


           



Thursday, September 5, 2013

Error message when you try to uninstall SharePoint Foundation 2010 or SharePoint Server 2010: "Microsoft SharePoint 2010 uninstall did not complete successfully"

This one drove me crazy.  Most people can solve the error with these two fixes:

  1. http://davidlimsharepoint.blogspot.com/2010/08/microsoft-sharepoint-server-2010.html
  2. http://support.microsoft.com/kb/981228
Unfortunately, mine was more esoteric.  The real issue was not a registry setting but a failed SQL Express install!

Dug out from my logs:

Can't uninstall Sharepoint Server 2010 - Error: Command: dbwrap.exe' failed with error code: -2068643838. Type: 8::CommandFailed.

Solution:

Uninstall the SQL Server Express !

http://social.technet.microsoft.com/Forums/sharepoint/en-US/7caf3aa0-b3c8-4a52-af7f-1527eee52828/cant-uninstall-sharepoint-server-2010-error-command-dbwrapexe-failed-with-error-code

How to uninstall an existing instance of SQL Server 2008 R2

Had an issue with a box with multiple SQL instances installed and needed to remove 2 instances.
I tried to use the SQL install msi but it does not include the tool to remove an existing instance.
I stumbled across this link http://msdn.microsoft.com/en-us/library/ms143412(v=sql.105).aspx.

I thought I would capture the steps visually since the description sometimes does explain where in the GUI the "magic" button is.


1.) Start > Control Panel > Uninstall a Program.  Select the Microsoft SQL Server 2008 R2 Package

 
2.) The next window select Remove

3.) Let the setup rules screen run and click ok.


4.) Select the instance you want to remove
 

5.) Select the features to remove.  Take care not to remove the Shared items as these are used by the other instances of SQL Server on the box.

6.) Select Remove and let the process complete.
 


 
7.) Success






Tuesday, September 3, 2013

MVC with Sproc and POCO

Looking at MVC for a new project and saw a lot of examples with LinqToSQL and EF.
What I wanted to look at was using MVC with an existing database design with existing
sprocs and views.  Dung's tutorial is using MVC 3 but with some tweaking I was able to
use MVC 4 and an existing db design.

Just finished working through this sample.  And it helped me out.
http://nndung179.wordpress.com/2012/04/10/mvc-3-and-stored-procedure-part-1/