-1
업로드 할 시나리오가 있습니다. 해당 파일을 내 솔루션에 복사하고 아래 코드를 사용하여 파일 경로를 가져오고 로컬에서 실행할 때 업로드 할 수 있습니다. 문제는 빌드가 완료되면 테스트 케이스를 실행하려고 할 때 발생합니다. 파일 경로를 검사 할 수 없기 때문에 오류가 발생합니다.TFS에서 파일을 읽고 C#에서 업로드하는 데 사용합니다.
string fileLocation = Path.Combine(Directory.GetParent(System.IO.Directory.GetCurrentDirectory()).Parent.Parent.FullName);
fileLocation = fileLocation + "\\BDD.Automation.files\\TestData\\testfile.xlsm";
시도하기 전에 [Directory.Exists()] (https://msdn.microsoft.com/en-us/library/system.io.directory.exists (v = vs.110) .aspx)를 사용해야합니다. 파일 이동. –
아래 코드를 구현 하려다가 오류가 발생했습니다. –
'fileLocation'의 존재 여부를 확인 했습니까? –