none
An expression is too long or complex to compile

    Question

  • Hi all,

    I encountered with the error " An expression is too long or complex to compile " from today morning, I am unable to find the source where the exact problem lies, since it is showing just the project name and nothing more than that along with the error line. I am working on SP2013 project consisting several Visual webparts. I saw in other portals about this error, but of no use. I tried cleaning solution/ Re-build.. re opened VS but  nothing is useful. Pl help asap since am unable to proceed further.

    Monday, January 16, 2017 11:27 AM

Answers

  • Not much information in output window, it is showing a different file every time I build the project and is throwing the same error.

    I resolved it by doing roll back to previous version from TFS. 

     
    Tuesday, January 17, 2017 6:51 AM

All replies

  • Praveen,

    The most common cause for this kind of problems: Is your project set to Debug (and not to Release)?


    Success
    Cor

    Monday, January 16, 2017 12:37 PM
  • Hi Cor Lighthert,,

    It is in debug mode only, still am facing the problem.

    Thanks for your reply :)


    Monday, January 16, 2017 1:01 PM
  • This usually happens in generated code, or when you have lots of terms chained together into a single expressions.

    Like "a" + "b" + "c" + "d" + "e" ...  /* imagine thousands of them*/

    So what code are you trying to compile? 

    As an experiment, try removing things from your code until the problem goes away.  This will help you isolate the fragment that causes the problem.


    • Edited by Wyck Tuesday, January 17, 2017 2:38 PM minor typo
    Monday, January 16, 2017 7:44 PM
  • Hi Wyck, 

    There is no lengthy concatenation in my code, it is a simple webpart for fetching data from sql and displaying in SP

    Thanks for your reply.

     

    Tuesday, January 17, 2017 3:38 AM
  • Check the Output window (from View menu), maybe it show some details.

    Tuesday, January 17, 2017 6:03 AM
  • Not much information in output window, it is showing a different file every time I build the project and is throwing the same error.

    I resolved it by doing roll back to previous version from TFS. 

     
    Tuesday, January 17, 2017 6:51 AM
  • Previous version of what?  The project file?  Some source code files?  Visual Studio?
    Tuesday, January 17, 2017 2:40 PM
  • Hi Wyck, 

    I did roll back of code to prev date, I mean source code.

    Tuesday, January 24, 2017 6:58 AM