Thank you again this time.
We are developing form applications that run locally in VisualStudio.
I stored string literals of about 5,000,000 characters in two patterns in two string type variables, respectively.
An error occurs during compilation. (Refer to the lower error text)
Please tell me how to avoid errors or alternatives.
This 5,000,000 character string is what was originally stored as a csv file and made into one line using a script.
By design, external files should not be referenced, so
I think that it is necessary to put this character string in exe.
The reason why you cannot refer to the external file is that I want to keep the contents of the csv file confidential.
Although it is an alternative that I thought of, it is as follows.
①Use the database
② Have csv file with zippass and unzip inside exe when referring
③ Place DataGritView in the main form with visible = Flase and store the data in it
I think that it is a project that should be adopted ①, but unfortunately there are few man-hours and a new DB
There is no time to learn related knowledge.
In addition, even if (2) is adopted, there is a possibility that the temporarily decompressed file may be placed somewhere during decompression, so it is inferior as a secret function.
If possible, it is desirable to avoid this error without changing the program already made.Error message
Supplemental information (FW/tool version etc.)
Error CS8103 The total length of user strings used in the program exceeds the allowed limit. Reduce the use of string literals.
Microsoft Visual Studio Community 2017
VisualStudio.15.Release/15.7.3 + 27703.2026
Microsoft .NET Framework
In the following, it is written that "String Object is 2GB or about 1 billion characters" can be stored.
In the following,
"I guess its a new compiler in VS2015, which restricts too much use of string literals."
"I think the new compiler in VS2015 is too restrictive to use string literals."
There is. Is there no help for the VS specification?
Answer # 1
The reason why you cannot refer to the external file is that you want to keep the contents of the csv file confidential.
In the first place, if you just write it as a string literal,it will be embedded in the executable file. The secret is whether it has an effect of comfort.
- i want to convert a string that reads a c # csv file to a number
- how to receive c # json string
- Java string replacement function replace () usage analysis
- Advanced usage of python3 format string f-string (recommended)
- c # - i want to edit a variable with the same name as the string of string from within struct
- Django implement string literals and auto-escaping in templates
- c # - netcore30 cpu usage is abnormal
- c # i want to get all file paths that do not contain the specified string
- how to read character string from standard input one by one in c # and cast to string type and put in array
- c # - search for "]" in the string
- c # - i want to separate the go string
- i want to make c # string a float
- c # - i want to separate the character string of string (regular expression)
- c # - i want to change the value read as a character string from a csv file to double type
- a method with a string as an argument in c #
- c # - how to specify the argument systemwindowsuielement as a string
- c # - about character string match judgment
- c # - systemformatexception the format of the input string is incorrect
- c # - typegettype how to represent a fully qualified class name using a string type variable as an argument
- i want to handle bitmap save path as string in c #
- c # - i want to enter the backspace key in the code due to the line limit of wpf textbox
- c # - how to call while keeping the control of the existing form
- c # - to know if the screen is being pressed inside a xamarin ios loop
- c # - screen transition by dynamically created button
- c # - how to get the path before the folder
- i would like to know how to limit the input value to 4 digits (c #)
- c # - i want to put a thread to sleep for a long time
- c # - i want to create an older version of an android app with xamarinforms, but i get a build error
- c # - about multi-display detection function
- c # - how to get multiple types of sums in a linq lambda expression