C# .NET 1.1 - Compiler Limit Exceeded for .csproj file on post build event -
i trying use csc.exe command line compile .net 1.1 .csproj project. failing following error:
myproject.csproj(24,2046): error cs1034: compiler limit exceeded: line cannot exceed 2046 characters
line 24 of .csproj file postbuildevent attribute of <settings> node. have lengthy post build event exceeds 2046 characters.
this project legacy application has been compiling 8+ years no problems until 2-6 weeks ago. (the last time compiled me on 6 weeks ago , didn't try again until couple weeks ago, , has been failing ever since.) tried removing service packs have been installed in time frame , did not change result. @ loss go here.
edit:
using eric j's advice below, shortened post build event moving of commands external .bat files , calling them like this. when try run csc.exe, getting following errors:
myproject.csproj(491,35): error cs1010: newline in constant
myproject.csproj(1,1): error cs0116: namespace not directly contain members such fields or methods
line 491 of project file <folder relpath = "xml\" />, , of course line 1 <visualstudioproject>.
it's it's trying compile .csproj file if .cs file. why? calling csc.exe this:
csc.exe /t:library /out:transformed\services\bin\services.dll *.cs cache\*.cs settings\*.cs transformed\services\*.cs /r:myreference.dll /r:mysecondreference.dll /nologo /debug /define:debug is seeing *.cs , of sudden including myproject.csproj reason? if so, how around this?
edit 2:
i came workaround. can see command line statement above, compiling *.cs, in same directory .csproj file. had hunch reason, trying compile project file if c# code. moved c# source files in root directory folder called services, , changed command line statement compile services\*.cs. works fine now.
i still don't know caused behavior change recently, if has insight appreciate it.
i'm not sure have changed cause post build event fail suddenly, may able resolve issue creating batch file or powershell script encapsulates lengthy event , call script instead.
Comments
Post a Comment