Sunday, August 23, 2015

Windows 10 Photo App Missing Images, Some Images Not Showing in Win10 Photo App When Source is Network Path or Mapped Drive - Move Offline Files Location in Windows 10

In this article:
  • Windows 10 Photo App Missing Images
  • Some Images Not Showing in Win10 Photo App When Source is Network Path or Mapped Drive
  • How to Move Offline Files Location in Windows 10
I recently installed Windows 10 and i really liked the Photo app and its simplicity is very alluring to me so i decided to go all out and let it index all my photos and see what it has to offer.

it took a while to index the images and the collection was built and showed what appeared to be all of my pictures.  it wasnt until i imported some new images and they didnt show up in the collection that i began to notice there was a problem.  

some research later and i read that the collection is built from the search index cache in windows.  the search indexer doesnt allow you to add network locations directly unless they are set to be "available offline" and then it indexes them by making use of their offline storage location on your computer's hard drive.

So from this we know that:
  • if you want to add images to the photo app collection they need to be in a location that is indexed by the search indexer. 
  • If you want the search indexer to index a network location, it needs to be on a mapped drive that is set to "make available offline"
  • so if you want to add photos from your network attached storage (NAS) to the windows 10 photo app then you need to map a drive an set it to be available offline.
From the above there is a problem.  generally you would have quite a large amount of data in your image library, or on your NAS in general.  if you have a 256GB SSD on your computer then making your NAS available offline is probably not going to be an option since offline files are stored on the same drive that windows is installed on.  specifically the c:\Windows\CSC folder.  Given that most people would have a few TB on their NAS your computers hard drive isnt going to cut it.

You might be thinking "simple, ill just change the location of the offline files folder to a location on a spare drive on my PC!".  not so easy i'm afraid.  but im going to show you a way to do this that is quite cool.

basically you need a spare hard drive that you can devote completely to your offline file storage.

firstly you need to turn offline files off, then reboot, then take ownership of the c:\windows\csc folder.

Takeown /r /f C:\Windows\CSC

then you need to delete the contents of the CSC folder 

you need to then bring the hard drive up in disk management, delete the volumes that exist on it if any, and create a new volume.  then when creating the volume mount it to an NTFS folder "c:\windows\csc".

now the CSC folder is mounted on the spare hard drive.  now turn offline files on again, then reboot.

now you can start making network folders offline and the data will be stored on the spare HDD.

Thursday, August 13, 2015

Lenovo x3250 M5 RAID Configuration - Can't Find Storage Menu

I recently had to build a Lenovo x3250 M5 server and realised that the most basic of servers is actually not as basic to setup as some of the bigger servers i have built

I realised quickly that the RAID configuration was to be done through the BIOS - Press F1 at startup logo screen, "System Settings" and then select the "Storage" option.  from there you launch the RAID controller's configuration tool.

On my server this "Storage" menu didnt exist and there was no documentation on how or why.

To show the RAID configuration and storage menu on an x3250 M5 you need to first select "Devices and IO Ports" and then change the RAID controller's function from SATA or AHCI to RAID.

Once you have made this change, you reboot, then try again and the "Storage" menu will appear.

Friday, July 10, 2015

Simple title case function for ASP.NET in VB. DotNet .NET title case. Capitalise first letter .NET

So first time today i realised there is no inbuilt function in .net to convert a string to title case (capitalise the first letter).  Seems crazy that you have to make your own.  anyway heres a really simple function in VB.NET

   Function toTitleCase(ByVal strIn As String) As String

        Return (UCase(Left(strIn, 1)) & Right(strIn, strIn.Length - 1))

   End Function

Tuesday, May 12, 2015

Remove Dot Net Nuke AJAX Partial Render Postback Overlay and Hourglass Busy Animation

When you set your Dot Net Nuke module to allow partial rendering, when the module is posted back, you get a very un-stylish washed out overlay that partially covers your page - it only covers the area that your module acquires - along with a less-than-flattering hourglass/busy animation.

Due to the way this overlay is positioned at run time it can sometimes be nowhere near your module, particularly if you have used some complex CSS or javascript to position your module.

Recently i wanted to have an ajax postback module on my partially rendered page but i didnt want this overlay/animation while the module was 'working'

This overlay comes as part of the Telerik AJAX resources included in DNN 6+.  It is delivered to the page as part of an AXD file and the contents can sometimes be difficult to find on your dotnetnuke install.

There is one simple way to remove this overlay in your module so when your module posts back the interface wont be obfuscated and you will be easily able to produce an AJAX postback module without drawing any attention to the fact that it is or has been working.

are you ready?

Simply add these 3 lines to your module's CSS file


Or add this in your ASCX file


There.  Don't say i never give you anything.

Note i haven't thoroughly tested whether or not this affects anything else on the page - i did test saving the settings of another module and the Telerik AJAX overlay and busy animation did display so that is enough to convince me that this mod is localised to the your module.

Tuesday, April 7, 2015

Windows 8.1 Server 2012 2012r2 Windows 10 Will not Boot with error 0xc0000225 - Your PC needs to be repaired A required device isn't connected or can't be accessed

all i wanted to do was replace a hard drive on my laptop and upgrade to a new SSD which is usually a very simple cloning and hdd replacement job.  When i rebooted i got a windows boot error screen telling me that i needed to reinstall windows.

So i spent half a day on this error, it was very frustrating and there are a number of simplistic blogs that might have helped some people however they involved BIOS changes that didn't match my BIOS and other changes that didnt specify enough detail.

So i thought i would bring the solution together

1) First up I found this guy -

however his article is quite specific to one type of BIOS so after making the changes that looked right it still didnt work anyway.

I just turned off secure boot and fast boot and moved on.

2) Then later i found this guy -

This article was the life saver however his article was kind of short and he left out some really important steps on exactly what to do so ill elaborate below

So lets get to it - firstly try this

boot into a similar operating system from USB or DVD and run the repair console which is available just after you enter your first regional and language settings.

Navigate through the menu and find advanced tools and run the command prompt and run the following commands

>Bootrec /fixmbr
>Bootrec /fixboot 
>Bootrec /rebuildbcd

These may all work or you may get an error, i got an error on the last one telling me that "the requested system device cannot be found"

next run diskpart and assign a drive letter (z) to the system partition

>list volume (look for system volume and note its number, sometimes it is identifiable because it is the only volume without a drive letter)
>select volume x (where x is the number of the system volume above)
>assign letter z

now we have assigned a letter to the system volume and we are going to copy the boot files there

>bcdboot c:\windows /s z: /f UEFI

Now just exit and restart.

Tuesday, September 3, 2013

Simple Access to the Xero API Example using VB.NET

Recently a client approached me and asked if we could link an application we recently developed with Xero.  Of course i said, this should be a breeze, i expect they will have all kinds of useful documentation and samples.

I have now spent the better part of a whole day just getting authenticated and pulling a simple list of accounts.  in the end, this is done by some simple setup and a few lines of code and nowhere is it documented how easy it really is.

This is an ASP.NET web application sitting in a Dot Net Nuke portal.

Here it is in VB.NET

1) download the xeroaip.dll file with nuget.exe here  you can use nuget.exe in the command line to just get the DLL file - check out this blog -  the package name is ""

2) add the DLL to your project in visual studio and make a reference to it in the references node.  you are now ready to go.

3) first create a new "session" object

dim xs = newSession()
Public Function newSession() As XeroApi.OAuth.XeroApiPublicSession

    Dim xSession = New XeroApi.OAuth.XeroApiPublicSession("[Application Name]", CONSUMER_KEY, CONSUMER_SECRET, New DevDefined.OAuth.Storage.Basic.InMemoryTokenRepository)
    Dim rt As RequestToken = xSession.GetRequestToken(New System.Uri("http://call.back.url/application.aspx"))

    Return xSession
End Function

4) store that Xero "session" in your .net session and redirect user to the page to approve access

Session("xeroSession") = xs

5) the user will be returned with a querystring which includes an "oauth_verifier".  pull your original xero "session" from the .net session and have it create the access token

Dim xs = CType(Session("xeroSession"), XeroApi.OAuth.XeroApiPublicSession)     
If Not xs.HasValidAccessToken Then             
End If

6) create a repository and you now have access

Dim xr As New XeroApi.Repository(xs) 
lblXeroConnected.Text = "Connected to " &  xr.Organisation.Name

7) a simple query to populate a drop down list

ddlAccounts.DataSource = getAccounts(xr)
ddlAccounts.DataTextField = "name"
ddlAccounts.DataValueField = "accountid"

Public Function getAccounts(ByVal xr As XeroApi.Repository) As XeroApi.Linq.ApiQuery(Of XeroApi.Model.Account) 
    Return From account In xr.Accounts Where account.Status.ToLower = "active" And account.Type.ToLower = "bank" 
End Function
Thats how simple it can be.