Category Archives: Uncategorized

SSDT for VS2017 – unattended install

download the install bootstrapper from Microsoft

create an offline install layout (optional)

Now that is complete, you can run the install manually or unattended

You must make a decision at this point. If you develop in Visual Studio, and you need to create installer projects as well as SSRS and SSIS projects, then you must install SSDT to a separate instance of Visual Studio. This requires the use of the installer flag “INSTALLVSSQL”, this tells the installer to create a separate instance of visual studio during installation
To view the options run c:\vs2017SSDT>SSDT-Setup-ENU /?

To kick the installer off unattended, you can either use /passive or /quiet

sql management studio Timeout expired

sql management studio Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

This can be a pain when you want to make changes that affect tables with large quantities of data

There are three location syou will need to check

In managament studio

Tools > options > Query Execution > SQL server > General

verify Execution time-out. for unlimited timeout set to 0

Tools > options > Designers > Table and Database designers

verify Transaction time-out. for unlimited timeout set to 0

when you first make the database connection, in the connection window popup, click on “options”. select the “connection properties” tab and verify the “connection time-out” and “execution time-out” are set to your liking. once again 0 is unlimited

CSS – Centre element to parent / page

Two ways to centre horizontally on your web page

using min-width and max-width. Use this when you need your element to be a fixed height from the top of the window

using absolute and width. use this when you want to be dead centre of the window

Configure ASP.NET WebAPI to default to JSON

you’ll need to add newtonsoft json to your project.

Application start, add the initialisation code

Now the code itself.

WhatsApp – network ports TCP/UDP

To Enable WhatsApp open these ports TCP/UDP

I had an issue with users trying to make video calls on WhatsApp, they simply couldn’t, so i spent some time on this and can safely say if you open these ports, WhatsApp will work for Data messages, Voice and Video calls.

  • TCP (4244, 5222, 5223, 5242) outbound
  • UDP (3478, 45395) send and recieve


Visual Studio – file properties – Build action

The various build action options

  • None: The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.
  • Compile: The file is compiled into the build output. This setting is used for code files.
  • Content: Allows you to retrieve a file (in same dir as assembly) as a stream via Application.GetContentStream( uri ). For this method to work, it needs a AssemblyAssociatedContentFile custom attribute which VS graciously adds when you mark a file as “Content”
  • Embedded resource: embeds the file in an exclusive assembly manifest resource.
  • Resource (wpf only): embeds the file in a shared (by all files in the assembly with similar setting) assembly manifest resource named AppName.g.resources.
  • Page (wpf only): Used to compile a xaml file into baml. The baml is then embedded with the same technique as Resource (i.e. available as `AppName.g.resources)
  • ApplicationDefinition (wpf only): Mark the XAML/class file that defines your application. You specify the code-behind with the x:Class=”Namespace.ClassName” and set the startup form/page with StartupUri=”Window1.xaml”
  • SplashScreen (wpf only): An image that is marked as SplashScreen is shown automatically when an WPF application loads, and then fades
  • DesignData: Compiles xaml viewmodels so that usercontrols can be previewed with sample data in visual studio (uses mock types)
  • DesignDataWithDesignTimeCreatableTypes: Compiles xaml viewmodels so that usercontrols can be previewed with sample data in visual studio (uses actual types)
  • EntityDeploy: (Entity Framework): used to deploy the Entity Framework artifacts
  • CodeAnalysisDictionary: A xml file containing custom word dictionary for spelling rules

Origin : Stack Overflow

Excel Automation unable to open file

Cannot access the file make sure it exists and you have permission

Microsoft Excel cannot access the file $path to file$. There are several possible reasons:

• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.

I was receiving this error while I was implementing excel automation in a WCF service

Oddly all you have to do is create two folders, or one if you are running a 32BIT OS

64 bit

·Windows 2008 Server x64

Please make this folder.


32 bit

·Windows 2008 Server x86

Please make this folder.


Update This is also happening in Windows Server 2012 R2

but the usual fix didn’t work. Oddly enough another folder is required

Windows SERVER 2012 R2

So it would seem that a folder named “Desktop” is required in the systemprofile folder in order that excel automation can open files

SQL Server Auto Backup Database Script

This Script Is what I use on all my database servers, its never failed and is extremely useful.

Just change the @PATH and the @BaseLine days as you see fit, paste the code into a job and run it everyday at midnight or what ever time your backups tends to run.

TFS 2010 Windows sharepoint Services Search

You type a search in the text box and hit search, you are then greated with

“Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information.”

You have TFS 2010 installed and everything is working, apart from the Search Services in the sharepoint portals

You try to manually start the service in the windows services console but it fails

You have followed microsoft instructions to enable and start the service but you cannot see the search service in central administration > Operations > services on server

Easily Fixed

You just need to do a repair of your WSS 3 install through programs and features. there is a catch though. When you try to perform a repair you recieve another error

“Microsoft Windows SharePoint Services 3.0 1033 Lang Pack – Error 1706th An installation package for the product Microsoft Windows SharePoint Services 3.0 1033 Lang Pack can not be found. Try the installation again using a valid copy of the installation package ‘wssmui.msi’.”

From Microsoft Download the Service Pack for Windows SharePoint Services Language Pack from here 64bit or here 32bit and install.

Now perform your repair.

Now browse to Central administration > operations > services on server and you will see as if by magic the search service is now available to configure. Click the start.

Configure Windows SharePoint Services Search Service Settings on server

Service Account: can be a local account \ or can be a domain account \
Content Access Account: can also be a local or domain account
Search Database: this is created automatically

NOTE- I suggest Using the account that you configured for the TFS to use when you were installing TFS 2010, this is because it needs full access to the SQL server and should NOT need to be an admin on the machine or domain. If you use the same account it also keep maintenance easy

Final Step – Add Search to an application database

  • goto central administration > application management > manage > content databases
  • Select the application database (on a fresh TFS instal it should be “WSS_Content”)
  • Search Server – select the only item in the drop down list (should be the server name)

TFS 2010 Installation guide & post install tweaks

If you need a good guide to install TFS 2010 then you need to download the guide from this location

Once you have followed the parts you need to, you might want to do as I did and make a few changes.

I also needed to do a few extra bits to have the functionality I required delivered to the server and TFS clients

  • Visual Studio 2010 and MSSQLMS (Microsoft SQL Server Management Studio) need to connect to TFS
  • VS 2010 must also compile and debug javascript/jquery in the background as much as it does for the .NET object model
  • I want to get the most out of my dev team so I am also going to install a couple of VS2010 extensions to make them work faster and more efficiently
  • The TFS 2010 server is going to have some handy Administration tools installed
  • TFS will also have Team Explorer 2010 installed and TFS 2010 service Pack
  • Use a FQDN for connectivity rather than machine name to access TFS requires loopback be disabled

So to begin with lets list the software and the download locations

loopback cure


add a REG_DWORD named “DisableLoopbackCheck”” and set it to decimal value 1



add a REG_MULTI_SZ and enter each domain name on new lines to allow loopback on only those domains

Changing Sharepoint URLs