.net core 3.0 및 C #을 사용하여 더 큰 솔루션을 구축하고 있습니다. 여기서 프로젝트 중 하나는 exe를 출력하는 콘솔 응용 프로그램입니다. 최근에 작업을 시작했지만 실행할 수 없습니다. Visual Studio (2019, 버전 16.3.10, Windows 10에서 실행)에서 디버그 모드로 시작하면 다음 메시지가 표시됩니다.
Invalid runtimeconfig.json [C:\loong-path\projectname\bin\Debug\netcoreapp3.0\projectname.runtimeconfig.json] [C:\loong-path\projectname\bin\Debug\netcoreapp3.0\projectname.runtimeconfig.dev.json]
C:\loong-path\projectname\bin\Debug\netcoreapp3.0\projectname.exe (process 3312) exited with code -2147450733.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
볼 때 runtimeconfig.json
정말 간단하고 정확 해 보입니다.
{
"runtimeOptions": {
"tfm": "netcoreapp3.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.0.0"
}
}
}
그리고 다음도 마찬가지입니다 runtimeconfig.dev.json
.
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\myusername\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\myusername\\.nuget\\packages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
]
}
}
빌드하기 전에 청소하고 빌드하기 전에 bin 폴더를 삭제했지만 runtimeconfig.json
다시 생성되고 동일하게 보입니다.
콘솔에서 dotnet으로 실행하려고 시도했지만 기본적으로 Visual Studio에서와 동일한 출력을 얻습니다. verbosity를 진단으로 설정 한 상태에서 실행하더라도 동일한 출력 ( dotnet run --no-build --verbosity diagnostic
)이 생성 되지만 그다지 도움이되지 않습니다. 결과를 projectname.exe
직접 실행할 때도 마찬가지 입니다.
나는 프로그램이 작동해야한다고 확신하지만 다른 두 사람의 컴퓨터에서 동일한 개정판이 작동하기 때문에 다른 근본적인 오류가 있음을 확신합니다. 그러나 실제로 자동 생성 runtimeconfig.json
파일에 문제가되지 않는 것 같기 때문에 실제로 문제가 무엇인지 파악하기 위해 정말 고심하고 있습니다.
bin 폴더에서 이와 같이 dotnet
직접 실행 dll
하면 실제 오류 메시지가 생성 C:\loong-path\projectname\bin\Debug\netcoreapp3.0> dotnet projectname.dll
되었습니다..
(기본 오류는 다음과 같습니다.
...
Unhandled exception. System.Exception: Failed to find or load OtherProjectName X509 certificate from local computer/personal certificate store.
---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
at System.Security.Cryptography.X509Certificates.X509CertificateCollection.get_Item(Int32 index)
at System.Security.Cryptography.X509Certificates.X509Certificate2Collection.get_Item(Int32 index)
...
이것에 의해 유발되었습니다.
var otherProjectNameClientCertificateColl = certificateStore
.Certificates
.Find(X509FindType.FindByThumbprint, _otherProjectNameCertificateStoreThumbprint, true);
var otherProjectNameClientCertificate = otherProjectNameClientCertificateColl[0];
(실패한 마지막 줄이었습니다.)
)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다