Upgrade TFS 2010 to 2015 on-premises

Was concerned this was going to be hard work, but turned out better than expected.

Really brief notes:

Install

TFS Server 2015 will install SQL Server 2014 standard

 

Process template upgrades

If the TFS work items intranet console does not work then:

  1. https://msdn.microsoft.com/library/vs/alm/work/customize/add-features-manually#update-processconfig
  2. Download process template
  3. I created .bat files to practice with a less significant project, then moved to main projects. Sample script below. Must be ran as administrator. May be remote to the TFS Server.
    Had to repeat for various work item types

 

cd C:\
set root="%programfiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE"
cd %root%
pause
witadmin importwitd /collection:http://<server>:8080/tfs/DefaultCollection /p:"<project>" /f:"D:\Users\<user>\Documents\Visual Studio 2015\VS-TFS Process Templates\Agile\WorkItem Tracking\TypeDefinitions\UserStory.xml"
echo Done
pause

 

 

 

 

Advertisements

Create an ODBC using a reg edit file

With thanks to:

https://kencenerelli.wordpress.com/2012/07/26/export-an-odbc-data-source-from-the-registry/

Save following as a file e.g. MyODBCName.reg
Double-click to install into the registry


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]
"MyODBCName"="SQL Server Native Client 11.0"

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\MyODBCName]
"Driver"="C:\\Windows\\SysWOW64\\sqlncli11.dll"
"Server"="MyServerName"
"Database"="MyDatabaseName"
"LastUser"="MyLastUserName"

Logging in .Net and My.Application.Log.WriteEntry does not write until flush

In app.config you need to remove the default listener:

<remove name=Default/>

Documentation on MSDN is ok, when testing you need to remember that the log will not write until either the application is closed, or the log is flushed. So:

My.Application.Log.DefaultFileLogWriter.AutoFlush = True
My.Application.Log.DefaultFileLogWriter.Flush()
My.Application.Log.TraceSource.Flush()

 

 

SQL Server Agent Job Verbose Logging

Please see useful page:

https://www.mssqltips.com/sqlservertip/1411/verbose-sql-server-agent-logging/

  1. In Job Step – Advanced – Output file
  2. Likely strategy is that on first step do not tick “Append output to existing file”
  3. On subsequent steps tick this and then you will get the full output of the series

 

 

Bug: Source not found, but some or all event logs could not be searched.

Bug:

The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. In accessible logs:Security

This can occur if a .Net application attempts to create the source at runtime, but not as an administrator. It is better to perhaps create the source ahead of time as an administrator in regedit, then just use the source in the application.

Private _eventLog As New EventLog(“Application”)
‘EventLog.CreateEventSource(SourceName, LogName, MachineName)

In registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\
Add permission to Authenticated Users = Full Control

Or add to the specific key.

With thanks to:
https://sandroaspbiztalkblog.wordpress.com/2012/02/16/the-source-was-not-found-but-some-or-all-event-logs-could-not-be-searched-inaccessible-logs-security/

 

 

How to keep the task bar visible when using a maximised RDP client

I use RDP a lot now, but would like to be able to see my own PC’s task bar, for instance Outlook may show messages.
It is possible, with thanks to:
http://notworthrepeating.blogspot.co.uk/2012/03/maximizing-remote-desktop-client.html

So:

  1. Edit your .RDP file using Remote Desktop Client, making sure the “Display” tab is configured for “Full Screen”, and then “Save” the .RDP file again (this bakes your local resolution into the file, which is important)
  2. Edit the .rdp in notepad:
    1. screen mode id:i:2  – change this line to the following, to use windowed mode instead of fullscreen
      screen mode id:i:1
    2. Add this line to the file if it doesn’t exist already:
      smart sizing:i:1
    3. Change nothing about (but take notice of) two lines that talk about “desktopwidth” and “desktopheight”
  3. Save and close the .RDP file

Thanks.

 

Calling a WCF service using SOAP in unit test or with VB Script on a classic ASP page

I created a WCF service in .Net and this was fine for .Net customers who use the Add Service Reference wizard easily enough.
However one customer was on classic ASP and he found it difficult to connect. So when we had succeeded together it was worth writing down. This is the result.
Please ignore the property naming. I don’t use strPropertyName. This isn’t working code, just an idea of what is required.

Solved.

Tips:

  • Inspect the .wsdl file
  • Note the soapAction setting
  • Note the namespace. The WCF namespace will include the interface name

Unit test written in VB.Net for SOAP

Public Sub SOAPClientHelloWorldTestMethod()

strURLSubFolder = “ServiceName.svc”
strInterfaceName = “IServiceName”
strFunction = “HelloWorldMethod”
Dim parameter1 = “parameter1”

strRequest2FunctionNameOpen = “&lt ns1:HelloWorldMethod &gt”
strRequest3Parameters = “&lt” + parameter1Value + “&gt”
strRequest4FunctionNameClose += “&lt ns1:HelloWorldMethod &gt”

CallSOAP()

End Sub

Then the SOAP call method

Private Sub CallSOAP()

‘URL to SOAP namespace and connection URL
Dim strURLBase = “http://serviceaddress.net/&#8221;
Dim strURL = strURLBase + strURLSubFolder
Dim strNamespace = “http://tempuri.org/&#8221;

strRequest1SOAPPart1 = “<?xml version=””1.0″” encoding=””UTF-8″”?>” & _

“<SOAP-ENV:Envelope ” & _

“xmlns:SOAP-ENV=””http://schemas.xmlsoap.org/soap/envelope/”&#8221; ” & _

“xmlns:ns1=””” & strNamespace & “””>” & _

“<SOAP-ENV:Body>”

strRequest5SOAPEnd = “</SOAP-ENV:Body></SOAP-ENV:Envelope>”

Dim strRequest = strRequest1SOAPPart1 + strRequest2FunctionNameOpen + strRequest3Parameters + strRequest4FunctionNameClose + strRequest5SOAPEnd
TestContext.WriteLine(“URL = ” + strURL)
TestContext.WriteLine(“Request = ” + strRequest)
Dim soapAction As String
soapAction = strNamespace & strInterfaceName & “/” & strFunction
TestContext.WriteLine(“SOAPAction = ” + soapAction)

Dim objectName As String
‘objectName = “Msxml2.XMLHTTP.3.0”
‘objectName = “MSXML2.DOMDocument.6.0”
objectName = “MSXML2.ServerXMLHTTP”

Dim soap_request As Object
soap_request = CreateObject(objectName)

Dim contentType As String
contentType = “text/xml; charset=utf-8”
‘contentType = “application/x-www-form-urlencoded”

soap_request.open(“POST”, strURL, False)
soap_request.setRequestHeader(“Content-Type”, contentType)
soap_request.setRequestHeader(“Content-Length”, Len(strRequest))
soap_request.setRequestHeader(“SOAPAction”, soapAction)

‘send the request and capture the result
soap_request.send(strRequest)
Dim strResult = soap_request.responseText
soap_request = Nothing

‘display the XML
‘response.write (strResult)
‘TestContext.WriteLine(strResult)
TestContext.WriteLine(“”)
Dim xml = XDocument.Parse(strResult)
TestContext.WriteLine(xml.ToString())

End Sub

Classic ASP

Title
<%
Dim strRequest, strResult, strElement, strURL, strNamespace,interfacename,soap_request,parameter1

‘ Define services
strURL = “http://serviceaddress.svc&#8221; ‘ Service URL
strNamespace = “http://tempuri.org/&#8221; ‘ Name space
interfacename=”IServiceName/” ‘ interface name
strElement = “GetMethod” ‘ Element

set soap_request = Server.CreateObject(“Msxml2.XMLHTTP.3.0″)
strRequest =”<?xml version=””1.0″” encoding=””UTF-8″”?>”

strRequest=strRequest& “<SOAP-ENV:Envelope xmlns:SOAP-ENV=””http://schemas.xmlsoap.org/soap/envelope/”&#8221; xmlns:ns1=”””&strNamespace&”””>”

strRequest=strRequest& “<SOAP-ENV:Body>”

strRequest=strRequest& “<ns1:HelloWorldMethod>”

strRequest=strRequest& “<ns1:parameter1>”&soap_user&”</ns1:parameter1>”

strRequest=strRequest& “</ns1:HelloWorldMethod>”

strRequest=strRequest& “</SOAP-ENV:Body>”

strRequest=strRequest& “</SOAP-ENV:Envelope>”

soap_request.open “post”, “”&strURL&””, False
soap_request.setRequestHeader “Content-Type”, “text/xml; charset=utf-8”
soap_request.setRequestHeader “SOAPAction”,strNamespace&interfacename&strElement
soap_request.setRequestHeader “Content-Length”,Len(strRequest)

Call soap_request.send(strRequest) ‘ Send the soap request and capture the result
strResult = soap_request.responseText

‘display the XML
if strResult”” then
Set ResponseXML = Nothing
end if
Set soap_request = Nothing

end if

%>

Device and Resource Redirection

https://technet.microsoft.com/en-us/library/cc725887(v=WS.10).aspx

Audio redirection

  1. Run
  2. Type “group” to open Edit group policy
  3. Local computer policy
  4. Computer configuration
  5. Administrative Templates
  6. Windows Components
  7. Remote Desktop Services
  8. Remote Desktop Session Host
  9. Device and Resource Redirection
  10. Allow Audio and video playback redirection
  11. Change from Not Configured to Enabled.

 

 

 

How to reinstate Contact Linking in Outlook 2013

For Outlook 2007 and 2010 there is an Option > Contacts > Linking > Show contacts linked to the current item

This has been removed in Outlook 2013, apparently because they have a new feature of Links when you are on People and the current view is People and then look at details. I don’t use that but and tend to use the List view which does not have the links. Also I have historic links, so wanted to reinstate links. Thanks to:

http://www.slipstick.com/outlook/2013/show-contact-linking-fields-in-outlook-2013/

Which I found via

http://www.outlook-tips.net/tips/tip-375-outlook-2007-contact-linking/

So steps copied from first of these are:

  1. Regedit
  2. HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Preferences
  3. Add DWORD: ShowContactFieldObsolete
  4. Set to 1

That page also referred to a Group Policy registry setting. I did not have that on my machine, did not create it and found that the links were there anyway

To remove:

Set to 0, or remove the Key

Solved.

 

Dataset Error: Failed to open a connection to the database – Synonym error

Dataset has been in production use for a long time. I use EF a lot now, but these still need maintenance and modifications for user requests. Error message was:

Wizard form
An unexpected error has occurred.
Error Message: Failed to open a connection to the database
Check the connection and network state and try again

Datasets will not connect Synonym

This was on a remote server so I thought there may be a timeout issue. However a search and thanks to:

https://social.msdn.microsoft.com/Forums/en-US/33575eae-24bd-470b-b93e-2083af49cfe8/unable-to-add-new-query-in-tableadapter-query-configuration-wizard?forum=adodotnetdataset

revealed that there may be a bad synonym in the database. The writer of that post used Activity Monitor, but SQL Profiler might also find that there was a wait resource of ExternalResource.

Although I did not check the Activity Monitor, I did check my synonyms and they were pointing at an old server. Repaired them to point at a correct location and the dataset issue has gone.

Solved.