"Could not load type" excepton when querying against a collection of enums

Discussion of issues, suggestions and bugs of LINQ Insight, Visual Studio add-in for design-time executing LINQ statements, that simplifies debugging LINQ
Post Reply
Entropy
Posts: 1
Joined: Fri 11 Apr 2014 17:43

"Could not load type" excepton when querying against a collection of enums

Post by Entropy » Fri 11 Apr 2014 18:02

Hello!
LINQ Insight 3.2.383, VS 2013 Ultimate.
When I try to run LINQ query against a collection of enums I get error: Could not load type...

Code: Select all

using System.Linq;

namespace LinqInsight
{
    public enum MyEnum
    {
        A, B, C
    }

    public class MyClass
    {
        public void Test()
        {
            // Run LINQ query
       
            // Numbers
            var number = new[] { 1, 2, 3 }.First(); // Success, result: 1.

            // Enums
            var enums = new[] { MyEnum.A, MyEnum.B, MyEnum.C }.First(); // Failure!
            // Message: Could not load type "LinqInsight.MyEnum" from assembly "LinqInsight, Version=0.0.0.0, Culture=neutral, PublicKeyToken=15a6ff96e314fffd".
            // Type: System.TypeLoadException
            // Source: LinqInsight
            // Site: GetQuery
            // Stack Trace: 
            //     at Query.GetQuery(Object[] args)
            //     at #=q1Gkt1x5R8goInzTG3xLMMPFAt4GYYvcDyRdRwQtbApWAIHk7lakXxn1War901mPRGM4CLgDyuf1Gpoe63woGGA==.#=qurPnXqoiKaUZk3hH4msHx2g4moc4CB86eb6AAVjWDTY=.#=qlfbndKiaI3W7oIfxysgSRw==()
            //     at #=q1Gkt1x5R8goInzTG3xLMMPFAt4GYYvcDyRdRwQtbApWAIHk7lakXxn1War901mPRGM4CLgDyuf1Gpoe63woGGA==.#=qx4XOnnl5ZkcezdfuJUQInn4yGbAdV8$JeL5t0pqiTfo=.#=qtuJ19xdfQrkdsRapJXQywH$ulWU$9HsPIodmeVFpAW2yh4PWkMAaTIa2ZVhUDGE5()
        }

    }
}
Just create new class library prooject ant try. Thanks.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: "Could not load type" excepton when querying against a collection of enums

Post by MariiaI » Mon 14 Apr 2014 10:41

Thank you for the report on this. We have reproduced this issue. We will investigate it and post here when any results are available.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: "Could not load type" excepton when querying against a collection of enums

Post by MariiaI » Tue 24 Jun 2014 06:46

New build of LINQ Insight 3.2.489 with the fix related to the 'Could not load file or assembly...' exception when executing a query that returns enum is available for download (please refer to http://forums.devart.com/viewtopic.php?f=50&t=29837 ).
This build can be downloaded from http://www.devart.com/linqinsight/download.html of from Registered Users' Area (provided that you have an active subscription).

Post Reply