outlook-matters icon indicating copy to clipboard operation
outlook-matters copied to clipboard

Error Converting value "G" to type 'OutlookMatters.Core.Mattermost.v4.Interface.ChannelType'.Path

Open oebridge opened this issue 7 years ago • 6 comments

I'm running Win10, Fall creators update, Outlook 2010. instlled the runtime as described in the instructions. wenn I refresh the channels, I get the error above.

I've already changed the name of VSTOInstaller.config --> to *.old in C:\Program Files (x86)\Common Files\microsoft shared\VSTO\10.0 as described in a different issue. didnt help.

On my hdd, there ist also \VSTO\9.0 installed...

image

do you have any ideas?

oebridge avatar Jan 31 '18 10:01 oebridge

I got the same error when I tried it today (version 2.0). I am also on Windows 10 Outlook 2013 image

attzonko avatar Feb 02 '18 23:02 attzonko

Same here. Outlook 2016 on Windows 7

Schoaf avatar Mar 06 '18 10:03 Schoaf

Actually here it's on another line: image

Schoaf avatar Mar 28 '18 07:03 Schoaf

I have the same error

ghost avatar Jul 04 '18 09:07 ghost

No solution ?

proximiteclient avatar Sep 19 '18 13:09 proximiteclient

A bit late, but just in case it helps somebody ... This happens because newer Mattermost versions create some channels with type "G" in the Channels table (at least when using MySQL/MariaDB):

MariaDB [mattermost]> select DisplayName, Type from Channels;
+------------------------------------------------------------+------+
| DisplayName                                                | Type |
+------------------------------------------------------------+------+
| Channel-1                                                  | D    |
| Firmantes                                                  | P    |
| Channel-5                                                  | P    |
| user01, user07, user22                                     | G    | <--- This channel
| Channel-7                                                  | P    |
+------------------------------------------------------------+------+

I was able to solve this (quick and dirty) by:

1-Adding a new "G" value to the ChannelType enum in ChannelType.cs under OutlookMattersCore Interface V4:

namespace OutlookMatters.Core.Mattermost.v4.Interface
{
    [JsonConverter(typeof(StringEnumConverter))]
    public enum ChannelType
    {
        [EnumMember(Value = "O")] Public,
        [EnumMember(Value = "P")] Private,
        [EnumMember(Value = "D")] Direct,
        [EnumMember(Value = "G")] Peers                  <--- Add this value
    }
}

2-Adding a new case to the ConvertType method in ChatChannels.cs:

private ChannelTypeSetting ConvertType(ChannelType type)
 {
    switch (type)
    {
        case ChannelType.Direct:
            return ChannelTypeSetting.Direct;
        case ChannelType.Public:
            return ChannelTypeSetting.Public;
        case ChannelType.Private:
            return ChannelTypeSetting.Public;
        case ChannelType.Peers:                          <--- Add these two lines
            return ChannelTypeSetting.Direct;
        default:
            return ChannelTypeSetting.Public;
    }
}

Then rebuilding the solution and reinstalling the VSTO plugin from the bin\Release folder (previously removing the old one from Control Panel -> Programs and Features, and deleting the "2.0" folder under "C:\Users\your-user\AppData\Local\Apps" on Win 10).

casanovg avatar Feb 09 '21 13:02 casanovg