Click here to Skip to main content
15,906,243 members
Home / Discussions / C#
   

C#

 
GeneralRe: More than 5000... Pin
Sean Michael Murphy2-Jul-07 15:28
Sean Michael Murphy2-Jul-07 15:28 
GeneralRe: More than 5000... Pin
DavidNohejl2-Jul-07 21:54
DavidNohejl2-Jul-07 21:54 
GeneralRe: More than 5000... Pin
PIEBALDconsult3-Jul-07 7:14
mvePIEBALDconsult3-Jul-07 7:14 
GeneralRe: More than 5000... Pin
DavidNohejl3-Jul-07 7:41
DavidNohejl3-Jul-07 7:41 
GeneralRe: More than 100000... Pin
vytheese2-Jul-07 23:16
professionalvytheese2-Jul-07 23:16 
GeneralRe: More than 100000... Pin
Sean Michael Murphy3-Jul-07 5:01
Sean Michael Murphy3-Jul-07 5:01 
GeneralRe: More than 5000... Pin
PIEBALDconsult3-Jul-07 7:37
mvePIEBALDconsult3-Jul-07 7:37 
GeneralMore than 1000000 [modified] Pin
PIEBALDconsult3-Jul-07 11:50
mvePIEBALDconsult3-Jul-07 11:50 
In reference to A: error CS1034: Compiler limit exceeded: Line cannot exceed 16777214 characters

The following succeeds at 1000000, and then I killed it while it tried 2000000.

C#
namespace MethodCountLimitFinder
{
    class Program
    {
        [System.STAThreadAttribute]
        static void Main ( string [] args )
        {
            Microsoft.CSharp.CSharpCodeProvider provider = 
                new Microsoft.CSharp.CSharpCodeProvider() ;

            System.CodeDom.Compiler.CompilerParameters cp = 
                new System.CodeDom.Compiler.CompilerParameters() ;
            cp.GenerateExecutable = false ;
            cp.GenerateInMemory = true ;

            System.CodeDom.Compiler.CompilerResults cr = null ;

            System.Text.StringBuilder inner = 
                new System.Text.StringBuilder ( "namespace Tester { class Test {" ) ;

            int methodCount = 1000000 ;

            while ( true )
            {
                System.Console.WriteLine ( methodCount ) ;
                
                for ( int i = methodCount ; i > 0 ; i-- )
                {
                    inner.AppendFormat ( "void M{0}(){{}}\n" , methodCount++ ) ;
                }
                
                inner.Append ( "}}" ) ;
                
                cr = provider.CompileAssemblyFromSource ( cp , inner.ToString() ) ;
                
                if ( cr.Errors.Count > 0 )
                {
                    break ;
                }
                
                inner.Remove ( inner.Length - 2 , 2 ) ;
            }

            foreach (  System.CodeDom.Compiler.CompilerError ce in cr.Errors )
            {
                System.Console.WriteLine ( ce.ToString() ) ;
            }
        }
    }
}



-- modified at 21:11 Tuesday 3rd July, 2007

2000000 and counting...

C:\>maxi
1000000
2000000
4000000
error CS0001: Internal compiler error (0x80004005)
error CS0001: Internal compiler error (0xc0000017)
error CS0583: Internal Compiler Error (0xc0000005 at address 5A16E208): likely culprit is 'PARSE'.
error CS0586: Internal Compiler Error: stage 'PARSE'
error CS0587: Internal Compiler Error: stage 'PARSE'
error CS0587: Internal Compiler Error: stage 'BEGIN'

C:\>



-- modified at 1:56 Wednesday 4th July, 2007

After 3000000 I started hitting resource limits and timeouts. So now I simply have a program write a file with the code and compile it at the command line, that got me to 4000000 so far...
GeneralRe: More than 5000... Pin
Sean Michael Murphy4-Jul-07 18:36
Sean Michael Murphy4-Jul-07 18:36 
QuestionError in calling a webservice Pin
ramdil2-Jul-07 3:15
ramdil2-Jul-07 3:15 
AnswerRe: Error in calling a webservice Pin
leppie2-Jul-07 3:58
leppie2-Jul-07 3:58 
AnswerRe: Error in calling a webservice Pin
Vasudevan Deepak Kumar2-Jul-07 4:53
Vasudevan Deepak Kumar2-Jul-07 4:53 
QuestionCan't focus TextBox on TabPage Pin
Tavbi2-Jul-07 3:01
Tavbi2-Jul-07 3:01 
AnswerRe: Can't focus TextBox on TabPage Pin
Luc Pattyn2-Jul-07 3:20
sitebuilderLuc Pattyn2-Jul-07 3:20 
GeneralRe: Can't focus TextBox on TabPage Pin
Tavbi2-Jul-07 19:57
Tavbi2-Jul-07 19:57 
GeneralRe: Can't focus TextBox on TabPage Pin
Tavbi2-Jul-07 20:27
Tavbi2-Jul-07 20:27 
AnswerRe: Can't focus TextBox on TabPage Pin
originSH2-Jul-07 3:50
originSH2-Jul-07 3:50 
GeneralRe: Can't focus TextBox on TabPage Pin
Tavbi2-Jul-07 19:33
Tavbi2-Jul-07 19:33 
QuestionRichTextField control issue Pin
Blubbo2-Jul-07 2:56
Blubbo2-Jul-07 2:56 
AnswerRe: RichTextField control issue Pin
Luc Pattyn2-Jul-07 3:11
sitebuilderLuc Pattyn2-Jul-07 3:11 
GeneralRe: RichTextField control issue Pin
Blubbo2-Jul-07 3:13
Blubbo2-Jul-07 3:13 
AnswerRe: RichTextField control issue [modified] Pin
Blubbo2-Jul-07 3:17
Blubbo2-Jul-07 3:17 
GeneralRe: RichTextField control issue Pin
Luc Pattyn2-Jul-07 3:25
sitebuilderLuc Pattyn2-Jul-07 3:25 
GeneralRe: RichTextField control issue Pin
Blubbo2-Jul-07 3:32
Blubbo2-Jul-07 3:32 
GeneralRe: RichTextField control issue Pin
Luc Pattyn2-Jul-07 3:46
sitebuilderLuc Pattyn2-Jul-07 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.