Blog Stats
  • Posts - 13
  • Articles - 0
  • Comments - 29
  • Trackbacks - 34

 

Sunday, March 12, 2006

System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'type': Error when trying to run a WCF (Feb 06 CTP) app

If create a new WinFX service project and try to run it, you may get a System.ServiceModel.ConfigurationErrorsException if you try to configure the service's endpoint using the same app.config code included in you service definition (the app.config code is commented out in the .cs file). This is because the included configuration code has a “type” attribute on the “service” element. It looks something like this:

<service type=”sampleservice”>

If you dig into the System.ServiceModel dll using reflector, you will find the configuration element that gets instantiated by this declaration in System.ServiceModel.Configuration.ServiceElement. Once you find this class, you will notice that there is no type attribute! So the XSD file that defines the serviceModel configuration section is wrong. Instead of type, declare a “name” attribute. Your code should run fine then (at least your service will start!).

Take Care!

Wednesday, March 08, 2006

So much cool stuff, so little time!

Sorry it's been a while since my last post, but if you have been keeping up with what microsoft is releasing, you would know what I have been busy with!

But for those of you who haven't stayed up to date, here's some things that are keeping me busy:

·       

·        The latest Vista CTP release

·        WinFX (check out System.Windows.Automation!)

·        .NET 2.0 (ASP.NET 2.0 rocks!)

·        Office 12 Beta 1

·        Team Foundation Server

·        Biztalk 2006

·        CRM 3.0

·        Windows Live!

·        Windows Server R2 (try writing a “claims aware” app

I promise to Blog about this stuff as soon as I have a chance!

Happy programming!

 

Denver .NET User's Group

I'll be doing a presentation for the Denver .NET user's group ( http://www.denvervisualstudio.net/ ) March 27, 2006. It is going to be a look at ASP.NET 2.0 from a ASP.NET 1.1 developers perspective.

Come check it out if you're in denver at the time!

Friday, December 23, 2005

Invalid operation exception when installing Windows Sharepoint Services (WSS) v3 Beta 1

Here's a post I had to hold back until we got the OK to blog about office 12:

 

So I finally had a chance to install WSS v3 Beta 1 tonight. After rushing home to install the new beta bits on a brand spanking new virtual machine I was let down to find that the installation failed to complete successfully. Seems that there was an unhandled exception in Step 3 of the WSS configuration process after WSS installs. Technically it is the step where the SPDiagnosticService is being configured (go figure). I tried doing some quick google searches and looking into the installation docs but no such luck finding the solution to my problem. I decided in was time again to crack open .NET reflector to see what was going on. Here is what I found:

During the configuration process, the SPDiagnoticService step attempts to configure the DACL of a particular registry key found at HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS

The code that is being executed looks something like this:

key1 = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS");

try

{

RegistrySecurity security2 = key1.GetAccessControl();

RegistryAccessRule rule = new RegistryAccessRule("Administrator", RegistryRights.ExecuteKey | (RegistryRights.CreateSubKey | RegistryRights.SetValue), InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow);

security2.SetAccessRule(rule);

key1.SetAccessControl(security2);

return;

}

finally

{

if (key1 != null)

{

((IDisposable)key1).Dispose();

}

}

 

So my first thought was that the process did not have the permissions to modify the registry, but when I tried to access the permission on the registry key in question I got a message from windows saying the DACL was in non-canonical form! Looks like during the installation process, the ACES in that DACL are added in the worng order! So to fix this issue, perform the following installation steps...

  1. Install the OS
  2. Install SQL 2005 (if you don't want to install MSDE)
  3. Install WWFx 1.2 beta
  4. Install WSS v3 beta 1
  5. There is two phases exectued during the installation of WSS. The first phase will install the bits. The second phase configures the server. The key to this is making sure you install WSS but DO NOT configure WSS until you perform the next step
  6. Open regedit. Navigate to HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS   Open up the permissions tab. When prompted by windows, allow it to repair the DACL to put it into canonical form
  7. Close regit and proceed with the configuration of WSS

I don't know what exactly caused the registry key DACL to become non-canonical, but this seemed to fix the issue. I want to also note that when installing Sharepoint Server 12, this problem doesn't seem to manifest itself.

If you have run across this problem yourself, I hope this post helped!

Saturday, January 28, 2006

MS CRM 3.0 Redepolyment Tool

If you have been wondering where you can find the CRM 3.0 redeployment tool, it has been right under you nose all along! Explore the CRM server CD/DVD and you will find a subfolder called “RedeploymentTool”. there you will find the redployment tool and the associated help file.

Monday, January 16, 2006

Tips to Upgrade Microsoft CRM 1.2 to Microsoft CRM 3.0

This weekend I was tasked with upgrading our production CRM system to 3.0 from 1.2. We had successfully upgraded a development server from 1.2 to 3.0 so how hard could the production server be? I think you all know the answer to that one. Here are some tips to get CRM 3.0 up and running in your environment:

 

  1. Backup all CRM databases and the web site directory where CRM is installed.
  2. Check to make sure the SQL server you are using has the correct server name registered as the default instance name. – In our production environment we had changed the name of the SQL server physical server name but never changed the instance name in SQL. To change the SQL instance name read the following article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_globals_64v9.asp. To determine if you need to change the name run “Select @@servername” against the instance you want to install CRM on. If it doesn’t return the name of your server, read the article above.
  3. Make sure replication is installed correctly on the server
    1. If you have any disconnected CRM users, make sure they have synchronized their data before continuing
    2. Run the 2 crm publishing agents found in SQL enterprise manager->Server->Replication Monitor. If they both generate articles correctly, you may be alright. If you get errors like “sp_MS**** stored procedure missing”, you may have a corrupted SQL server. I re-ran SQL service pack four and it corrected this issue.
  4. Rebuild the CRM distribution database
    1. Follow the instructions found here: http://support.microsoft.com/kb/872585/en-us
    2. Make sure you follow the link to the SQL script to clean up replication object. Run the script against master,  _MSCRM and _METABASE databases
  5. Microsoft has had mixed success with doing upgrades when publishing was enabled. If you can, temporarily disable publishing before starting the upgrade
  6. Disable any CRM workflows.
  7. Start the upgrade process. If the validation process succeeds, you more than likely will be ok.

 

If you run into issues trying to install SQL reporting service and the CRM reports on a server that is using SSL, look at the certificate installed to see if it is a wildcard certificate i.e. “*.yourdomain.com”. If it is, choose to ignore the SQL reports error during setup; yu can come abck and deploy reports later. Perform these additional steps:

 

  1. Fix the MSCRM registry key.
    1. Export the following key: HKLM->Software->Microsoft->MSCRM. File the export away for safe keeping.
    2. Goto HKLM->Software->Microsoft->MSCRM. Find the SQLRSServerURL value. The url will have the wildcard value if you are using a wildcard SSL certificate. Change the URL to the correct HTTPS url.
  2. Make sure the RSReportServer.config and RSWebApplication.config files have the correct url to the report server. Search for your wildcard certificate site name in these files. If you find any malformed urls, fix the url and save. The config files should be found in the SQL server application installation directory under /MSSQL/ReportingServices/ReportServer and /MSSQL/ReportingServices/ReportManager directories
  3. Reconfigure the .NET runtime on the web server to not check SSL site names when connecting to remote servers. Read the following article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhostingremoteobjectsininternetinformationservicesiis.asp. In the section about using SSL with .NET remoting, you will find a config setting called checkCertificateName. You will have to set this to false on your server.

 

 

  To republish the CRM SQL reports, do the following:

  1. Open a command window. Run->”cmd”
  2. Change directory to the CRM program files Reports  installation directory ex. C:\program files\Microsoft CRM\Reports
  3. There you will find an exe called “PublishReports”. You need to pass two arguments to this program (put quotes “” around both):
    1. The CRM organization name. This is the name you used when you originally installed CRM
    2. The SQL reporting group name in the form “domain\name”. you can find this name by opening  the AD users and computer snap-in, browsing to the OU where you installed CRM and finding the group called “Reporting Group {}”. Open the properties of this group and copy the group name. Paste it into the cmd window in the form “\
    3. Run the program

 

Wednesday, January 18, 2006

Debug Problems with CRM 3.0 Outlook Client Synchronization

Getting the outlook synchronization to work correctly can get a bit tricky, especially if you are working with an existing CRM database upgraded from 1.2. Here are some tips to help you out:

 

 

After you complete these steps, you should be ready to install the client application. If your clients are laptops which will work disconnected at times, you will want to install the full client “Client.msi”. For desktops, use the light client “LightClient.msi”. Refer to the CRM 3.0 Implementation guide for descriptions of these two applications and instructions on how to deploy them in your enterprise.

 

When outlook starts up, the CRM client will begin synchronization of records. At startup, quickly goto the CRM main menu in Outlook and select Show Synchronization Progress. You want to do this quickly because once the process starts, the UI is not that responsive. If you see the following symptoms, you may have a problem with synchronization

  • Progress window does not appear
  • Progress window does not show any progress being made (after many minutes)
  • The progress window appears, then disappears suddenly
  • The Outlook window does not respond at all
  • The outlook process constantly takes a 60+% of processor resources
  • The outlook process continues to consume memory without stoping

 

If you notice any of these symptoms, you may have a synch process stuck in an infinite loop. To determine if this is the case, you need to turn on CRM Outlook Synchronization Tracing. This requires registry key changes that ARE NOT DIRECTLY SUPPORTED BY MICROSOFT (These keys are not documented anywhere). Make these changes at your own risk. Make sure you back up the CRM client registry key before continuing. HKCU->Software->Microsoft->MSCRMCLIENT.

 

Copy the following into a text document:

 

Windows Registry Editor Version 5.00

 

[HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient]

"TraceDirectory"="c:\\crmtrace"

"TraceEnabled"=dword:00000001

"TraceCategories"="*:Verbose"

"TraceCallStack"=dword:00000001

"TraceRefresh"=dword:00000001

"TraceSchedule"="Hourly"

 

Put whatever local drive location you wish in the TraceDirectory key. Makes sure this directory exists on the client machine.

 

Save the document with a  “.reg” extension. The will make it a registry merge file. Copy this file to the client machine you want to trace. Double click on the file and choose to merge the registry values into the registry. CRM outlook client tracing is now setup on that client computer.

 

Restart outlook. The synchronization process should start again. Open windows explorer and navigate to the directory you specified in “TraceDirectory”. You should now see log files in this directory (if you don’t see them right away, wait a few seconds). Let these files grow for a little bit (a minute or so) then open the log file that was growing. You will see verbose tracing about the synchronization process. Look for repeating error sections. You will probably notice that the error is around a particular record in CRM. Look at the XML for that record. Look for thing like:

 

  • Malformed XML
  • Bad character data
  • Malformed email addresses
  • Malformed web addresses

 

If you see anything unusual, fix the record either using CRM (preferred) or directly in SQL (not supported by Microsoft). Re-run the synchronization process and re-examine the log files. Repeat until you get the process working correctly.

 

Happy Debugging!

Saturday, December 17, 2005

How to Setup Visual Studio 2005 to use the Microsoft Symbol Server

One of the first things you will want to do after installing visual studio is to set it up to automatically pull down the correct symbols for system components when debugging. You do this by configuring Visual Studio to use the Microsoft Symbol Sever.

In VS 2005, do the following:

  1. Open Visual Studio. Goto Tools->Options
  2. Expand the “Debugging“ node
  3. Click on the “Symbols“ node under “Debugging“
  4. Click on the icon that looks like the new folder icon to add a new .pdb location
  5. Type the following for the location “smysrv*symsrv.dll*c:\symbols*http://msdl.microsoft.com/downloads/symbols“
  6. In the Cache symbols from symbol servers to this directory, enter the local path you used in step 5. In this case “c:\symbols“
  7. Click Ok.

To test it out, try attaching to some windows process like iexplore.exe (if you have IE running). Goto debug->windows->modules. You should now see that symbols are loaded for all the system dlls and iexplore.exe. You can also open the local path used in step 5 and you should see folders for all the dlls that have been debugged so far.

Happy Debugging!

How to determine backup information in SQL 2005

Another question I got at the denver launch was how can someone check to see if a database (in SQL 2005) was backed-up or not. There is a couple of ways you can get this information

  1. Use the SQL Management Studio. Open the studio, right click on the database in question, choose restore, restore database... On the general tab you will see the backup sets associated to this database.
  2. If you have a backup file and want to get more information, you can use commands RESTORE FILELISTONLY, RESTORE HEADERONLU, RESTORE LABELONLY. Please refer to books online to get detailed information about these commands.
  3. Go and query the MSDB tables directly.MSDB contains all the information you will need about the what backups have ran. for instance, to query all the backup sets for a database called “FOO“ you could execute “Select * from backupset where database_name='foo'“. Other tables you might be interested in are: Backupfile, Backupfilegroup, Backupmediafamily, Backupmediaset, Backupset. Complete descriptions of these tables can be found in books online.

 

Rebuild Master Database in SQL 2005

A while ago a friend told me that he was having problems rebuilding the master database in SQL 2005 running on WindowsXP SP2. I wanted to verify the steps to rebuild master when runnnig on Windows XP since I rarely work on XP boxes just to make sure there were no hidden gotchas in the process. Here is what I did to rebuild the master db in the environment described above:

Step 1. Put SQL Server into Single User Mode

The first thing you will want to do is stop the SQL Sever Sevicer (sqlservr.exe) and the associated services (Agent, Full Text, Etc). There are a few ways to do this, but the easiest way would be to use the SQL Configuration Manager (Start->All Programs->Microsoft Sql Server 2005->Configuration Tools->Sql Server Configuration Manager). From this console you can manage the various SQL server services running on the machine. Right Click on each service listed and stop the service. The services are stopped, you can proceed to Step 2.

Step 2. Start the SQL server in Single User Mode

Open a command window and navigate to the folder where Sqlservr.exe resides (generally <install drive>:\Program Files\Microsoft Sql Server\MSSQL.1\MSSQL\Binn). Run “sqlserver.exe -m”  to start the sql server from single user mode.

Step 3. Rebuild the system databases

In SQL 2005, the rebuildm.exe program is nto supported. To rebuild the master database you need to use the setup.exe found on the SQL 2005 installation media. To rebuild, use the following command “start /wait setup.exe /qn INSTANCENAME=<instance> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<New SA Password>”. Please refere to Books on Line for compelete details on how to use Setup.exe.

Step 4. Restart the SQL Server Services in regular mode

End the command shell you started earlier. Ctrl-C to stop SQL server in single user mode, then close the command window. Go back to the Sql Server Configuration Manager and restart the SQL services.

 

Thursday, December 15, 2005

Team Build TF42046: The Build Service used in the build process is not reachable

 

If you encounter the TF42046 error, you may want to make sure of a few things:

 

  1. That Team Build is installed on the build machine. This can be found on the Team Foundation Server installation CD in the BB directory. Run setup to install Team Build
  2. Make sure the Team Build Service is running. Open the services MMC snapin and look for Team Build Service. Make sure the service is running. Also note the account that the service runs as; you will need it for the next step
  3. Make sure the Team Build Service account (from step 2) is in the “TFS Service Accounts” group. For more information see http://blogs.infosupport.com/raimondb/archive/2005/11/28/bbsvcacc.aspx
  4. Make sure the designated Team Build port is listening and available thru any firewalls. By default, the port used is 9191. Open a command prompt on the build machine and run “netstat”. Make sure TCP port 9191 is listening. You may want to make sure The Team Build service has this port and not another application on the build server. Make sure this port is not blocked by the window’s firewall or any other firewall in you enterprise.
  5. Make sure the paths defined in your PATH system variable do not have any invalid characters. This includes any “” around the paths. Part of the Team Foundation Build Client source code attempts to build the path to msbuild.exe using the paths defined in this environment variable. Unfortunately the exception that is thrown when the system attempt to call Path.Combine on a malformed path is masked by the misdirecting TF42046 error.
  6. If all else fails, turn on verbose tracing by navigating to the build server’s build service install directory and uncomment the trace flags in the TeamBuildService.exe.config file. You can find this file at “<install drive>:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\”. You can verify this directory by checking the run directory listed in the properties window of the TeamBuildService found in the services snapin.

 

I had a hard time getting Team Build to run on most of my servers because of #5. In my lab environment, all of my servers have Norton Ghost running on them. It seems that when Norton installs, it added a path to the PATH environment variable and wraps it in “”. Once I removed the “”, everything worked fine. All I can say is “thank god for Reflector!”

 

Sunday, December 04, 2005

Windows Authentication not working (by design) in IIS 6.0 on Windows Server 2003 SP1 when you use host headers

On Windows Server 2003 SP1, if you configure an IIS site to use a host header and configure that site to use windows integrated authentication, you may have experienced problems logging in to the site.

The symptoms can include:

  • IIS prompting for credentials event though you are logged into the domain and have configured IE to pass credentials automatically.
  • Not being able to log into the site no matter what username/password you use
  • Getting HTTP 404.1 when trying to access the site
  • Authentication events in the security event log like Event ID 537 : An error occurred during logon

If you have encountered these problems, your issues may be related to a new feature added to Windows Server 2003 SP1 and Windows XP SP2. The feature at fault is the Loopback check security feature that helps mitigate reflection attacks that was added to the operating system in these service pack releases. A detailed description of the issue can be found at:   http://support.microsoft.com/?kbid=896861

To resolve the issue you can either turn off the loopback check on the entire server or indicate which host header map back to the local loopback address.

Method 1: Disable Loopback Checking

  1. open regedit
  2. Find HKLM\System\CurrentControlSet\Control\Lsa
  3. Create a new DWORD value called DisableLoopbackCheck and give it a value of 1
  4. Restart the computer

Method 2: Specify Host Names

  1. Open regedit
  2. Find HKLM\system\CurrentControlSet\Control\Lsa\MSV1_0
  3. Create a new multi-string value called BackConnectionHostNames
  4. Add the host headers to this value that map back to the local loopback
  5. Restart your computer

 

Tuesday, December 06, 2005

Official "Rock The Launch" in Denver Today

Today Microsoft launched Visual Studio, SQL Server 2005, and BizTalk 2006 Beta 1 in Denver (These products officially launched Nov. 7th). The event was a great success with about 2000+ engineers in attendance ranging from hobbyists to seasoned professionals. I enjoyed participating in the “Ask the Experts” panel which allowed me to meet many attendees and answer questions about two of my favorite products, VSTS and SQL 2005. Hopefully I helped everyone who asked questions about these products!

There seemed to be a common thread among the questions around Team System and Team Foundation Server that I will post about next week. Some of the topics I expect to hit are:

  • The Team Foundation eventing model
  • Team Foundation work item integration and automation
  • MSBuild and Team Build (how to setup nightly and continuous builds)
  • Testing with Test Rigs

Some other things I was questioned about that I will be discussing:

  • Various topics around ASP.NET and C#
  • WebParts in WSS and ASP.NET 2.0
  • Performance issues around CLR stored procedures

If you have a topic that you would like to see posted, feel free to drop a suggestion!

 

 

Copyright © Tom Wisnowski