성태의 닷넷 이야기
작은 글씨
큰 글씨
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] 한국어 로컬 모델 풀 파인튜닝 - LLM 바닥부터 만들기 (대형...
[정성태] 그러고 보니, 저도 노안이라서... 어느 순간부터 웹 브라우저 ...
[정성태] The case of the invalid handle erro...
[정성태] 해당 글을 잠시 읽어보니까, 그 글에 답이 잘 나오는군요. ^^...
[정성태] Stating the obvious about debugging...
[정성태] https://www.c-sharpcorner.com/artic...
[정성태] How can I detect if one of my helpe...
[정성태] 32비트 값을 64비트 레지스터에 넣을 때, 상위 32비트에 대...
[정성태] 본문에서 상위 8바이트의 16비트가 사용되지 않는 것을 볼 수 ...
[정성태] 한 번도 궁금한 적이 없었는데, If I mark my t...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>C# - CodeDomProvider 사용 시 Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '...\f2_6uod0.tmp'.</h1> <p> CodeDomProvider를 사용한 응용 프로그램이 고객사의 특정 서버에서만 다음과 같은 식의 컴파일 오류가 발생하고,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Line number 0, Error Number: CS2001, 'Source file 'C:\Windows\TEMP\kilsykm3.0.cs' could not be found Line number 0, Error Number: CS2001, 'Source file 'C:\Windows\TEMP\kilsykm3.1.cs' could not be found Line number 0, Error Number: CS2001, 'Source file 'C:\Windows\TEMP\kilsykm3.2.cs' could not be found Line number 0, Error Number: CS2008, 'No source files specified </pre> <br /> 구체적인 예외 메시지는 DirectoryNotFoundException으로 나옵니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\temp\ConsoleApp1\bin\Debug\extension\f2_6uod0.tmp'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated() at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile) at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources) at ConsoleApp1.Program.Main(String[] args) in C:\temp\ConsoleApp1\Program.cs:line 57 </pre> <br /> 고객사 서버를 구체적으로 검사할 만한 상황은 아니었지만, 그동안의 경험으로 ^^ 봤을 때 아마도 해당 서버에 설치해 둔 보안 프로그램이 "C:\Windows" 하위 폴더에 생성된 임시 파일들을 강제 삭제하기 때문에 CompileAssemblyFromSourceBatch 메서드 수행 시점에는 해당 파일들이 없어 저런 오류가 발생하는 것으로 보입니다.<br /> <br /> 그래서 임시 파일의 생성 경로를 "%TEMP%"가 아닌 명시적인 로컬 폴더를 지정하는 것으로 바꿨고, 이후 오류 없이 응용 프로그램이 잘 동작했습니다. ^^<br /> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
2126
(왼쪽의 숫자를 입력해야 합니다.)