반응형
C# 프로젝트를 빌드할 수 없습니다.
이상한 문제가 생겼어요.
이 코드를 사용하면 빌드할 수 없지만 빌드 오류는 발생하지 않습니다.
암호
public void myMethod()
{
//This returns a string in JSON format.
var jsonResponse = myApi.ReadMobileDevice("1");
dynamic dynamicJson= JsonConvert.DeserializeObject(jsonResponse);
//THIS LINE BREAKS MY BUILD. NO BUILD ERRORS SHOWN
var jValue = dynamicJson["general.display_name"];
}
빌드 브레이크가 발생하는 이유와 빌드 오류가 표시되지 않는 이유를 설명해 주실 수 있습니까?
업데이트 - 출력
* var를 문자열로 변경
1>------ Build started: Project: Control, Configuration: Debug x86 ------
1> Restoring NuGet packages...
1> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
1> All packages listed in packages.config are already installed.
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(563,28,563,40): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
1>C:\ActacomProjects\DEV-Google\Control\Classes\DomainObjects\Schedules\HTTPSchedulesResponse.cs(41,34,41,36): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\Classes\DomainObjects\Schedules\HTTPSchedulesResponse.cs(87,30,87,32): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1225,26,1225,45): warning CS0219: The variable 'recreateApplication' is assigned but its value is never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1809,71,1809,74): warning CS0168: The variable 'dnf' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(1813,54,1813,56): warning CS0168: The variable 'ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5017,34,5017,36): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5087,42,5087,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5154,42,5154,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5192,42,5192,44): warning CS0168: The variable 'Ex' is declared but never used
1>C:\ActacomProjects\DEV-Google\Control\ModifyService.svc.cs(5267,42,5267,44): warning CS0168: The variable 'Ex' is declared but never used
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
출력에 다음 오류가 있습니다.
필요한 컴파일러 멤버 'Microsoft'가 없습니다.CSharp.RuntimeBinder.CSharpArgumentInfo.작성'
DLL 마이크로소프트에 대한 참조를 추가해야 합니다.Csharp.dll.
Saminathan S가 인정된 답변에서 언급한 것과 유사합니다.를 사용하고 있는 경우.NETSandard 프로젝트(NETSandard 2.0의 경우)는 Microsoft를 추가해야 합니다.이 빌드 오류를 해결하기 위한 참조가 아닌 NuGet의 CSharp.Mac에서 Visual Studio Community를 사용하고 있었습니다.
신속한 해결.
오른쪽 클릭Packages
>Add NuGet Packages...
>Microsoft.CSharp
이건 나한테 효과가 있었어.[맥, 비주얼 스튜디오 2017 커뮤니티]
.csproj 파일을 편집하여 이를 추가할 수도 있습니다.이 경우 @the-senator가 말한 것과 같은 결과가 됩니다.
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
언급URL : https://stackoverflow.com/questions/32475021/unable-to-build-c-sharp-project
반응형
'programing' 카테고리의 다른 글
oracle sql developer를 사용하여 데이터베이스 간에 복사 - 연결에 실패했습니다. (0) | 2023.03.13 |
---|---|
WooCommerce 주문 합계 가져오기 (0) | 2023.03.13 |
리액트 및 노드에 대해 프록시가 작동하지 않음 (0) | 2023.03.13 |
JSON에서 TypeScript 클래스 인스턴스로? (0) | 2023.03.13 |
Ionic 어플리케이션에서 하드웨어 되돌리기 버튼을 비활성화하시겠습니까? (0) | 2023.03.13 |