代码之家  ›  专栏  ›  技术社区  ›  Adrian Godong

.NET+TeamCity:未编译专用访问器

  •  0
  • Adrian Godong  · 技术社区  · 17 年前

    我正在为VS2008 sln文件运行teamcity-Pro(v4.0.2 build8222)。

    现在我面临一个问题,测试项目中私有访问器的自动生成代码没有生成,并且由于找不到那些(自动生成的)类而导致编译错误。

    是否需要更改任何配置?我检查了vsbuild日志,它没有显示自动生成类的任何msbuild条目。自动生成类的DLL就在那里。

    2 回复  |  直到 17 年前
        1
  •  0
  •   vpolozov    17 年前

    另外,TeamCity不使用msbuild实用程序来构建解决方案。你不想吗 ask TeamCity developers ?

        2
  •  0
  •   Paul Alexander    17 年前

    alt text http://www.deploylx.com/so/tcbuildrunner.jpg

    使用MSBuild运行NUnit测试

        <PropertyGroup>
            <NUnitCommandArgs Condition="'$(NUnitCommandArgs)' == ''">$(NUnitCommandArgs) /noshadow /timeout=30000</NUnitCommandArgs>
            <NUnitCommandArgs Condition="'$(TestGroupInclude)' != ''">$(NUnitCommandArgs) /include=@(IncludeTestGroups, ',')</NUnitCommandArgs>
            <NUnitCommandArgs Condition="'$(TestGroupExclude)' != ''">$(NUnitCommandArgs) /exclude=@(ExcludeTestGroups, ',')</NUnitCommandArgs>
        </PropertyGroup>
    
        <ItemGroup>
            <NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.0.*" />
        </ItemGroup>
    
        <ItemGroup>
            <NUnitRuntimeFiles Include="$(ToolsPath)\nUnit\nunit.core.dll" />
            <NUnitRuntimeFiles Include="$(ToolsPath)\nUnit\nunit.core.interfaces.dll" />
            <NUnitRuntimeFiles Include="$(ToolsPath)\nUnit\log4net.dll" />
        </ItemGroup>
    
        <Target Name="RunUnitTests" >   
    
            <Message Text="Include=@(IncludeTestGroups), Exclude=@(ExcludeTestGroups)" Importance="High" />
    
            <MakeDir Directories="$(ToolsPath)\addins" />
    
            <Copy SourceFiles="@(NUnitAddinFiles)"
                  DestinationFolder="$(ToolsPath)\addins"
                  />
    
            <Copy SourceFiles="@(NUnitRuntimeFiles)"
                  DestinationFolder="$(TestFolder)" />
    
            <Exec
                WorkingDirectory="$(ToolsPath)\nUnit\"
                Command="&quot;$(ToolsPath)\nUnit\nunit-console-x86.exe&quot; &quot;%(TestAssemblies.FullPath)&quot; $(NUnitCommandArgs)"
                />
    
        </Target>