I'm deploying an application built with VS 2010 Express edition via ClickOnce.
I have associated some file extensions using the options provided in the Publish section of the project's properties.
When I install the application, the associated file extension icons appear normally in Explorer but, when the user tries to open a file in my application, the associated icons appear blank.
The relative code section is the following:
Dim dialog As New OpenFileDialog
With dialog
.AddExtension = True
.CheckFileExists = True
.CheckPathExists = True
.DefaultExt = "pss"
.FileName = String.Empty
.Filter = "Data files|*.pss|All files (*.*)|*.*"
.FilterIndex = 0
.InitialDirectory = MySettings.SavePath
.Multiselect = False
.ValidateNames = True
If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
OpenFile(.FileName)
End If
End With
I was always under the impression that OpenFileDialog is a wrapper for Explorer, but for some reason the icons don't appear correct.
Does anyone have any idea how to correct the problem?
Edit: The behaviour is only relevant to Windows 7. Windows XP behaves normally.
I forgot to change the included associated icons to:
I found this thanks to the manual updates, during which I was getting the error message "Object Reference not set to an instance of an object" during the
updateCompleted
event.