Click here to Skip to main content
15,888,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

What I have tried:

I try to delete cache of visual studio 2015 but nothing affect
Posted
Updated 24-Feb-19 22:55pm

1 solution

Well I wouldn't call that "ambiguous"! You have exceeded the amount of string literals that the compiler can handle and you need to reduce that.

Here are some ideas to help you do that:

If you are using the same text repeatedly (e.g. In error messages) then consider using Consts to minimize re-use of words unnecessarily - see How to: Define Constants in C# | Microsoft Docs[^]
Constants - C# Programming Guide | Microsoft Docs[^]

Consider using a resource file to hold your string literals - see this CodeProject article .NET String Resources[^]
Or this one from MS - Working with .resx Files Programmatically | Microsoft Docs[^] (NB These articles refer to this as a great way of handling multiple languages - but it works when only one language is involved too!)

You refer to your project being "big" - you could try to break it down into multiple assemblies e.g. Creating Satellite Assemblies for Desktop Apps | Microsoft Docs[^] or class libraries - e.g. see Creating C# Class Library (DLL) Using Visual Studio .NET[^]

Without knowing anything about your style of coding, or being able to see any of your code I'm afraid we will struggle to help you much beyond this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900