none
ambiguous error happen when build project on visual studio 2015 ? RRS feed

  • Question

  • Problem

    ambiguous error happen when build project on visual studio 2015 ?

    error : Combined length of user strings used by the program exceeds allowed limit..

    How to solve this error please ?

    my project big and have more files and cannot know 

    on which place this problem come 

    problem happen on csc file and i dont know on which place this file exist

    and also how to solve this problem 

    Monday, February 25, 2019 3:12 AM

Answers

  • Hi

    Is your problem solved? If so, please post "Mark as answer" to the appropriate answer, so that it will help other members to find a solution quickly if they face a similar issue.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, February 28, 2019 3:21 AM
    Moderator
  • OK thank you for reply

    my problem solved but until now i dont know place that make that error done

    meaning which file or which project make this problem

    Tuesday, August 20, 2019 10:57 AM

All replies

  • There is an explanation in the last answer to this post:

    https://stackoverflow.com/questions/37193372/c-sharp-combined-length-of-user-strings-used-by-the-program-exceeds-allowed-limi

    One way to solve the problem is to move any large strings into the resources (.resx file). In this way you do not overflow the string table used by the Roslyn compilar.

    Monday, February 25, 2019 7:47 AM
    Moderator
  • Thank you for reply

    can i do any thing can avoid this error please ?

    Monday, February 25, 2019 8:00 AM
  • can i do any thing can avoid this error please ?

    Options for avoiding the error:

    • Move some large strings out so that instead of being written in quotes within the source code they are embedded in a resource file. You can then retrieve them from the resources at runtime instead of compile time.
    • Split your code into several separate files so that none of them have too many strings.
    • Move back to an older version that doesn't use the Roslyn compiler.
    Monday, February 25, 2019 11:00 AM
    Moderator
  • thank you for reply

    how to go to older version of Roslyn compiler 

    are you mean using visual studio 2013 

    another point is OK understand 

    this point can you give me more details about what you mean older version of Roslyn compiler

    Monday, February 25, 2019 11:42 PM
  •  what you mean older version of Roslyn compiler

    No, I didn't say an older version of the Roslyn compiler. I meant an older version of Visual Studio which does not use the Roslyn compiler. I think that it was introduced in VS 2015, so you would have to go back to VS 2013, but I am speaking from memory here, I may be wrong about this version.
    Tuesday, February 26, 2019 7:19 AM
    Moderator
  • thank you for reply

    I have two questions if possible i need answer to it

    1- this problem happen also on visual studio 2017 so are visual studio 2017 using Roslyn compiler also ?

    2- you tell me that static string is more what you mean static string

    are you mean physical files and normal coding is more 

    or 

    string a="hellow word";

    or csharp coding is more than allowance for visual studio

    can you help me answering these questions please ?

    thank you

    Wednesday, February 27, 2019 12:18 AM
  • Greetings.

    I think Alberto is telling you the problem is you have too many strings like this.

    string s = "Hello World";  // Like this.
    SomeMethod("Here I am."); // Or this
    
    // Or anywhere strings appear in double quotes "".

    The solution is to move those strings (or some of them, at least) into a resource file.

    Then instead of doing this...

    Console.WriteLine("Hello");
    Console.WriteLine("World");

    you can do this.

             Console.WriteLine(ConsoleApp6.Properties.Resources.Greeting);
             Console.WriteLine(ConsoleApp6.Properties.Resources.Place);
    

    Wednesday, February 27, 2019 1:13 AM
  • Hi

    Is your problem solved? If so, please post "Mark as answer" to the appropriate answer, so that it will help other members to find a solution quickly if they face a similar issue.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, February 28, 2019 3:21 AM
    Moderator
  • OK thank you for reply

    my problem solved but until now i dont know place that make that error done

    meaning which file or which project make this problem

    Tuesday, August 20, 2019 10:57 AM