1

I've tried to run my UWP program in release mode and I got such an error:

Error: NUTC3054:The generic parameters are too complex. This may be an indication of infinite generic expansion which is not currently supported while loading type 'NpgsqlTypes.NpgsqlRange1<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlPoint>>>>>>>>>>>>>'. while loading type 'Npgsql.TypeHandlers.RangeHandler11<NpgsqlTypes.NpgsqlRange1>>>>>>>>>>>>'. while compiling method 'instance Npgsql.TypeHandler Npgsql.TypeHandler1<NpgsqlTypes.NpgsqlRange11<NpgsqlTypes.NpgsqlRange1>>>>>>>>>>>>.CreateRangeHandler(Npgsql.PostgresTypes.PostgresType)'.

It works perfectly in debug mode. Any ideas where is the problem? EDIT: Code:

string connString =
            String.Format(
                "Server={0}; User Id={1}; Database={2}; Port={3}; Password={4}; SSL Mode=Prefer; Trust Server Certificate=true",
                parameter.Host,
                parameter.User,
                parameter.DBname,
                parameter.Port,
                parameter.Password);
            NpgsqlConnection conn = new NpgsqlConnection(connString);
            try
            {
                conn.Open();
                if(conn.State == System.Data.ConnectionState.Open)
                {

                    conn.Close();
                }

            }
            catch (Exception ex)
{}
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
JSzut
  • 166
  • 2
  • 12
  • 1
    Amazing error message! But you're going to have to show us some code or we can't even guess why it's happening. – DavidG Mar 22 '18 at 14:45
  • It seems to be not important as everything works fine in debug mode. Looks like it is Npgsql However, question updated with the code. – JSzut Mar 22 '18 at 14:49
  • The error messages mentions specific types, are those types defined in your code? – Lasse V. Karlsen Mar 22 '18 at 14:52
  • 2
    I like how the error message seems to imply that one day, "infinite generic expansion" is a feature that's going to be supported. Somehow, I doubt that. – Jeroen Mostert Mar 22 '18 at 14:52
  • @JeroenMostert If you think about it I'm sure you can agree that it's actually quite easy to support infinite generic expansion. It just takes infinitely long to do so, and thus you've implemented it with a `while (true) { }`. There, I fixed it. – Lasse V. Karlsen Mar 22 '18 at 14:53
  • 1
    @UweKeim Please make sure you format it correctly if you're going to "fix" formatting. You just lost lots of angle brackets. – Lasse V. Karlsen Mar 22 '18 at 14:54
  • 2
    When building a UWP in Release it will use .Net Native (this is not used in debug). The error you getting is from .net native but dont think this code is causing the error. If you plan to release your app via the store you will need to be able to make a release build. The .net native is very helpful most of the time; drop them an email at: dotnetnative@microsoft.com. – Dave Smits Mar 22 '18 at 14:57

0 Answers0