잘, Visual Studio가 설치되어 있지 않아 설치하고 싶지 않으므로 .csproj 파일과 모든 소스 파일도 컴파일하는 일괄 파일을 만들었습니다.
문제는 .dll 파일을 포함하는 방법을 모른다는 것입니다. 여기에서 내 .csproj 파일의 현재 code가 있습니다.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <AssemblyName>Project</AssemblyName> <OutputPath>Bin\</OutputPath> </PropertyGroup> <ItemGroup> <!--.cs files --> <Compile Include="program.cs" /> </ItemGroup> <Target Name="Build"> <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')" /> <Csc Sources="@(Compile)" OutputAssembly="$(OutputPath)$(AssemblyName).exe" /> </Target></Project>
DLL 파일을 컴파일 프로세스에 포함 시키거나 참조하려면 변경해야합니까?
- 답변 # 1
참조라는 항목이있는 항목 그룹이 필요합니다.
비 GAC'D DLL을 참조하는 경우 HINTPATH를 입력해야합니다 (MVC 미니 프로파일 러 참조, 이는 빌드 파일 위치에 상대적이어야합니다). ReferencePath 속성에서.