Welcome to David Sandor Sign in | Join | Help
Resolved: If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress ...

I received the following error when connecting to a WCF service hosted on a remote server:

http://SERVERNAME:8200/DevSQL.ReplicatorService/Signaler/
System.ServiceModel.Security.SecurityNegotiationException: SOAP security negotiation with 'http://SERVERNAME:8200/DevSQL.ReplicatorService/Signaler/' for target 'http://SERVERNAME:8200/DevSQL.ReplicatorService/Signaler/' failed. See inner exception for more details. ---> System.ComponentModel.Win32Exception: Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/SERVERNAME'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server.
   at System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.GetNextOutgoingMessage(Message incomingMessage, T negotiationState)
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout)
   at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
   at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at DevSQL.Replicator.SignalerSvc.ISignaler.Ping()
   at DevSQL.Replicator.SignalerSvc.SignalerClient.Ping() in ...SignalerSvc\Reference.cs:line 118
   at DevSQL.Replicator.BackupUtility.signalRemoteServers() in ...\BackupUtility.cs:line 84

The .NET Framework 3.5 SP1 README gives the answer:

 

2.3.2.2 Breaking changes in the SspiNegotiatedOverTransport authentication mode
When WSHttpBinding, WS2007HttpBinding, or NetTcpBinding is used with SecurityMode = TransportWithMessageCredential and a client credential type of Windows, clients that previously authenticated to a service by using NTLM will now fail to authenticate, with the following error:
"System.ComponentModel.Win32Exception: Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/<hostname>'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server."
The error appears when the service is running on an account that has an identity other than 'host/<hostname>'. This issue also applies to CustomBindings, which specify the SspiNegotiatedOverTransport authentication mode.
To resolve this issue:
If possible, clients should be updated by using a UPN or SPN endpoint identity that specifies the identity of the service so that Kerberos authentication occurs. The following configuration snippet shows how to do this in the UPN case; the SPN case is similar, but the <servicePrincipalName> element is used instead.
<system.serviceModel>
      <client>
         <endpoint>
            <identity>
               <userPrincipalName value="user@domain" />
            </identity>
          </endpoint>
     </client>
</system.serviceModel>

Additionally, clients that use NetTcpBinding or CustomBindings, with SspiNegotiatedOverTransport specified in the stack over SslStreamSecurityBindingElement, must specify a custom IdentityVerifier in the code to perform the CN check of the service's certificate. The following code snippet shows how to do this and provides a starting point for IdentityVerifier implementations.

Resolved: Event Type clr20r3, .NET Runtime Error, Event ID 5000

Funky error received:

Windows Service failed to start and logged an Event ID 5000 in the Application Event log with the following details:

EventType clr20r3, P1 devsql.replicatorservice.exe, P2 1.0.3293.22912, P3 49639851, P4 devsql.replicatorservice, P5 1.0.3293.22912, P6 49639851, P7 f, P8 8, P9 system.typeinitialization, P10 NIL.

 

Note P9 is key here.  If you googled this event ID and you do not have a system.typeinitialization error as P9 this blog entry will NOT help you.  My only advice to you is this:  Debug your code, try catch the heck out of your code, or follow this thread's advice for creating an unhandled exception handler (oxymoron?):

http://social.msdn.microsoft.com/Forums/en-US/clr/thread/f165f3fc-8107-4e39-b2b0-0375370a5a07/

 

So first you must understand that this error occurred (for me) when a static constructor (or static field initializer) is trying to create a type and fails.  It happens too quick to catch in your service and even if you debug the heck out of it you still won't be able to catch it properly because it is thrown from a static.

Check any lines of code that initialize a static variable / object.

In my case the problem was log4net references in my code:

private static readonly ILog log = LogManager.GetLogger(typeof(Signaler));

log4net is actually GAC'ed on my dev machine so it did not include the log4net assembly in the output ( ./bin/Debug ) folder.  I XCOPIED the debug folder to my test machine, installutil'ed the service and it failed to start. 

Copying the log4net assembly to the test server fixed my problem.  This allowed the static initializer to create the log4net reference and viola!

SOLVED: ClickOnce Deployment and IIS 7 does not work.

If you publish a .NET application to an IIS 7 server click once deployment fails with HTTP 404 errors on .manifest, .application, and .deploy files.

After googling I found a blog article that went through a bunch of horribly poor suggestions involving giving administrative access to the IIS account and installing IIS 6 compatibility features on the server.  In a word:  unnecessary.

The solution is simple:

Add a script map into the application context that maps the .deploy, .manifest, and .application extentions to the aspnet_isapi script handler.

Capture

Request Path

*.manifest

Executable

%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Name

(Whatever you want, I called mine ClickOnce1 - 3)

Capture2

SOLVED: The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. HTTP 404.3

 

Windows Server 2008 and IIS 7.  Deployed a new set of WCF services to the server and received the following error:

HTTP Error 404.3 - Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

 

As it turns out IIS 7 does not create the script mapping for WCF out of the box.  The solution is simple:

 

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y

Problem solved.

Solved: Visual Studio 2008 SP1 Crash

I have a fresh install of Vista Business x64 with a clean install of Visual Studio 2008 SP1.  I updated my Telerik R.A.D. Controls Winforms from an older 2007 version to 2008 Q2 SP1.  After which (and I do not fault Telerik for this as it is a VS2008 issue not a Telerik issue) my Visual Studio 2008 SP1 started crashing.  My event log had errors such as this:

.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (000007FEF957203F)

The remote debugger is unable to communicate with Visual Studio, and must abort the remote debugging session. Please restart debugging.

Faulting application devenv.exe, version 9.0.30729.1, time stamp 0x488f2b50, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, fault offset 0x330001ca, process id 0x136c, application start time 0x01c92d91f586f1eb.

.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (6EC00F92)

I solved the problem by doing the following:

Close Visual Studio if it is open (in fact it is a good idea to stop all programs that are running).

Delete all files in: (skip locked files)

C:\Windows\Temp

C:\Users\<UserDir>\Local Settings\Temp

if you are still on Windows XP:

C:\Documents and Settings\Local Settings\Temp

and most importantly

C:\Users\<UserDir>\Local Settings\Microsoft\VisualStudio

if you are still on Windows XP:

C:\Documents and Settings\Local Settings\Microsoft\VisualStudio

Restart Visual Studio 2008 and you should be good to go!

Google Chrome Crashed - Fresh Install

Whoa! Google Chrome has crashed. Restart now?

Nice.  On the news reports I see college students proclaiming how horrible Internet Explorer is and how it crashes all the time.  Usually because of some add-in or virus they mistakenly downloaded from the internet.  I installed Google Chrome and after the installation the installer attempted to start the application and I was greeted with the following screen shot.  Back to the drawing board?  I am not sure when the last time was that I actually saw IE crash like this.. 1995?  1996?  Talk about taking a step back in time! 

chrome-crash

HTML Parsing with .NET and C# (HTML Parser)

I was in need of an HTML parser for a small project.  I have written parsers using Regular Expressions (RegEx) in the past.  I found one that worked quite well for me.

Here is the link to the open source project:
http://www.majestic12.co.uk/projects/html_parser.php

SOLVED: The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.

When installing SQL Server 2008 or the SQL Server 2008 Management Tools I received the error:

The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.

Some searching uncovered this thread which someone recommended deleting the registry key: 

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90

This is a bit drastic so I experimented and found that I could simply delete the key:

32 bit: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools

64 bit: HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\90\Tools

I did not even need to restart the install, just click re-run on the rules page and the prerequisite rules all passed this time.

sql2008install

SOLVED: Creating virtual directory Reports for Report Manager... Error: 2147746366.

While installing Team Foundation Server (TFS) 2008 with Service Pack 1 (SP1) I received the following error:

 

"C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\TFRSConfig.exe" /setup /repair /s "SERVER" /u "NT Authority\NetworkService" /buildInIdentity /l "1033" /verify /ignoreExistingIISArtifacts /instancename "MSSQLSERVER" /appPoolName "UnusedSinceThisIsSql2008WhichDoesNotUseIIS" /reportServerUri "http://SERVERNAME:80/ReportServer" /reportManagerUri "http://SERVERNAME:80/Reports" /h "SERVERNAME"

In the MSI Log file:

TFRSConfig - Team Foundation Server Reporting Services Configuration Tool
Copyright (c) Microsoft Corporation.  All rights reserved.

Connecting to SQL Server Reporting Services. Please wait...

Creating application pool UnusedSinceThisIsSql2008WhichDoesNotUseIIS...

Creating virtual directory Reports for Report Manager...
Error: 2147746366.
Exception of type 'Microsoft.TeamFoundation.Admin.ReportingServices.ReportingSer
vicesWmiException' was thrown.

Configuring SQL Server Reporting Services failed.

After reading some forums I found that a solution is to edit the web bindings in the Reporting Services configuration tool.  My system is installed on Windows Server 2008 Standard with Microsoft SQL Server 2008 Developer Edition.

I first slipstreamed the TFS 2008 install to SP1 by doing this:
http://davidsandor.com/blogs/tipsandtricks/archive/2008/08/15/solved-how-to-install-team-foundation-server-2008-on-windows-server-2008-with-sql-server-2008.aspx

After which I received the messy error above.  I truly believe this is a MAJOR bug with the TFS 2008 and TFS 2008 SP1 installer.  They do not properly configure reporting services even with a clean default install.  My server was freshly installed with Server 2008 STD + SQL 2008 just for this install. 

On to the solution:

  1. Navigate to start | All Programs | Microsoft SQL Server 2008 | Configuration Tools |  Reporting Services Configuration Manager.
  2. Connect to the instance of reporting services. (In my case, the default MSSQLSERVER)
  3. Change the IP Address to All Assigned (Recommended).
    ssrs1
  4. Click Apply.
  5. Click on the Report Manager URL section and then click Advanced.
  6. Select the IP Address in the list and choose edit.
  7. Make sure the IP Address selected in the drop down is All Assigned.
    ssrs2
  8. Click OK then OK then Apply then Exit.

 

Restart your merged Team Foundation Server 2008 with SP1 setup and you are good to go!

SOLVED: Could not find required file 'setup.bin' in 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine'.

Error Message:

Error 3 Could not find required file 'setup.bin' in 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine'.

-or-

Error 3 Could not find required file 'setup.bin' in 'C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine'.

When attempting to publish a .NET application with Click Once Deployment I received the error above which was a MSBUILD MSB3174 error.  I received this error in my Visual Studio 2008 located on my desktop PC but not on my laptop. 

Strangely enough I had some AVG Virus scan warnings that I overlooked until now.  As it turns out my AVG had targeted my setup.bin file as a possible trojan.  Of course it is not so I relocated the file back out of my virus console and my click once deployment published as it should.

Very inexpensive DELL server.

dellsc440These units are GREAT for development.  It is a very inexpensive Dual Core DELL server class machine.  I have 5 of these at home for my development lab.  They use SATA hard drives and ddr2 memory.  Plenty of room for expansion.

Click here to get one for $249.

Then click servers and you will see a link for the $249 SC440.

Solved: How to install Team Foundation Server 2008 on Windows Server 2008 with SQL Server 2008

I Googled and Googled and found no meaningful results on this.. just a bunch of people who plagiarized other people's blog postings. 

So the nutshell on this is: Slipstream the SP1 into the TFS 2008 installation.

What you need:

  1. TFS 2008
  2. TFS 2008 SP1
    http://www.microsoft.com/downloads/details.aspx?familyid=9e40a5b6-da41-43a2-a06d-3cee196bfe3d&displaylang=en
  3. TFS 2008 SP1 Installation Guide
    http://www.microsoft.com/downloads/details.aspx?familyid=FF12844F-398C-4FE9-8B0D-9E84181D9923&displaylang=en

 

Load up the .CHM file you downloaded in step 3.  Click the search tab and then type merge.  You will find the How to: Integrate the Installation of Team Foundation Server and Service Pack 1.

Below is an excerpt from the How To:

To integrate the installation of Team Foundation Server and Service Pack 1
  1. Download SP1 from the Microsoft Web site, and save the update to a folder on the local computer.

    For example, you can save the file to C:\SP1Download.

  2. From the files that originated on the DVD for Team Foundation Server, copy the AT folder to a location on the local computer.

    For example, you can copy the folder to C:\InstallMedia.

  3. Open a Command Prompt window, and type the following command, replacing C:\SP1Download with the location that you chose in step 1 and C:\SP1Extract with a separate location on the local computer:

    C:\SP1Download\TFS90SP1-KB949786-ENU /extract:C:\SP1Extract

  4. Create a folder where you can merge files from SP1 and the DVD.

  5. Type the following command, replacing C:\InstallMedia with the location that you chose in step 2, C:\SP1Extract with the location that you chose in step 3, and C:\MergeFolder with the absolute path of the location that you chose in step 4:

    msiexec /a C:\InstallMedia\vs_setup.msi /p C:\SP1Extract\TFS90sp1-KB949786.msp TARGETDIR=C:\MergeFolder

    Note:

    You must replace C:\MergeFolder with an absolute path, but you can replace C:\InstallMedia and C:\SP1Extract with absolute or relative paths.

  6. From C:\MergeFolder (which you created in step 4), run setup.exe to install Team Foundation Server with SP1.

Microsoft Visual Studio 2008 Service Pack 1 ( SP1 ) Released

BEFORE RUNNING THE SP 1 install you need to run the Visual Studio 2008 Hotfix Cleanup Utility.

The HFCU Utility can be found here:

http://code.msdn.microsoft.com/RemoveKB944899

The service pack 1 for Visual Studio 2008 can be found here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

There are a lot of changes:

vs2008sp1_01

Look at all the features added to VS2008:

•SQL Server 2008 Community Technology Preview (CTP) support is added to Visual Studio 2008.

•The following Visual Basic PowerPack controls have been added:

Line

Shape

Data Repeater

•In Visual Basic, the Windows Communication Foundation (WCF) Service renaming process is improved.

•Document level features are included for application level add-ins in Visual Studio Tools for Office.

•Design-time support has been added in the ClickOnce application for file name extensions and Start menu customization.

•You can send mail from work items in Team Foundation Server.

•Version control usability improvements and Microsoft Visual SourceSafe (VSS) converter improvements have been made in Team Foundation Server.

•Improved Team System Web access integration with notifications has been added in Team Foundation Server.

•In Visual Studio Team Edition for Developers, support has improved for Internet Information Services (IIS) 7 in the Visual Studio Performance Tools (Profiler).

•In Visual Studio Team Edition for Developers, 64-bit mixed mode (native/managed) instrumentation support has been added in the Profiler.

•In Visual C++, the Libraries support for Technical Report 1 (TR1) is added.

•In Visual C++, the Microsoft Foundation Class (MFC) is improved to support the appearance and behavior of Microsoft Office.

•In Visual Web Developer, SQL Server 2008 support for Web projects is added.

•In Visual Web Developer, JavaScript formatting support is added.

•In Visual Web Developer, the WCF Service renaming process is improved.

•Debugging changes improve support for inspecting the results of in-memory Language-Integrated Query (LINQ) queries.

•A new Visual C# feature is added to provide a richer set of error information about code.

•Visual Studio Industry Partners (VSIP) partners are enabled to install one copy of files for a package that can be used by multiple isolated applications.

•In Windows Presentation Foundation (WPF) Designer, snaplines are now implemented for margins. This behavior enables the designer to control a fixed distance from other controls, container edges, or gridlines.

•Visual Studio Tools for Office System (VSTO) is improved to support add-in error logging.

•XSD Schema Explorer is improved.

•The Step Into Specific debugging feature and the Step Filtering debugging feature for managed properties and managed operators are changed.

•The debugger now can cancel symbol and source downloading from Microsoft Public Symbol Servers.

•Streamlined support for Reference Source is added to the debugger.

•The ADO.NET Entity Designer is added to ease data access.

•You can now add “Local Database Cache” to device projects.

•ASP.NET Dynamic Data templates and toolbox controls are added.

•IIS 7.0 Managed Module and Handler templates are added.

•Support for starting the WCF Test client debug of a WCF Service file (.svc) by pressing F5 is added.

Object is currently in use elsewhere.

Wow! Cool error:

objectinuse

LINQ to SQL Visual Object Designer O/R Mapper

Building data objects in Visual Studio 2008 is really nice.  Having been a .netTiers veteran (and contributor) I have appreciated O/R Mapping tools for some time now.  I must say that the new Visual Designer is pretty neat.  I am working on a quick WPF / WCF application to manage a customer's orders from a simple database.  This tool worked out great for a quick 45 minute application.

l2s-orders

My next step in this little app is to see how I can modify the O/R code template to write these classes as WCF serializable objects fully decorated with the DataContract and DataMember attributes.

EDIT:  I figured this out pretty quickly.  By clicking on the white space of the dbml designer and examining the properties pane you will find a serialization property.  Setting this to unidirectional is the same thing as using the /serialization switch on SQLMetal.  The result is a data class decorated with WCF compatible serialization attributes.

Spiffy!

datacontextclassproperties

More Posts Next page »