-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running with an x86 csproj #23
Comments
As indicated in the displayed settings, your use of the Use of a Closing this as an answered question. Feel free to ask for follow-up as we will see it and respond. |
I get the same error if I remove the --x86 option. |
That’s an odd error message for this problem. Can you share the testresult.xml file? |
@ChrisMaddock You're right. That's the result you would normally get if the vs-project-loader extension were not availble. It's as if it's available for one of them and not for the other. I wonder if this is a regression for when multiple projects are specified in the command-line? @glen-nicol what if you specify the two assembly paths? |
@ChrisMaddock I can probably share snippets of the results. Is there something in particular you want to see? |
I think it may be an engine or console issue. Let's examine further before moving. More than one project on the command line was a new feature in NUnit 3. IIRC we had some issues and fixed them. @glen-nicol can you run multiple IL only projects? |
So I added an IL platform to the x86 assembly. Which is fine, I really just specify x86 to ensure visual studio runs the tests as a 32 bit process because it calls into a native dll that is 32bit. It picks up the IL path and tries to find the assembly in \bin\Release instead of \bin\x86\release. If I build the project for IL then the tests run just fine. But it definitely seems like the engine is not interpreting the x86 path correctly. I can understand it not necessarily being able to determine between the two platforms when they are both there without the solution but if it is just x86 I think it should still work. Is there a way to point it at my solution and then give it a filter for the projects? like
That way it can actually read the configuration manager data to determine the correct paths to use for the configuration and platform? |
@glen-nicol In that case, it really may be a problem with the project loader. The basic question is whether the project loader has to deduce the path or if it's fully spelled out in the project file. Perhaps you can post some or all of your project file so we can try to replicate this. |
@glen-nicol Unfortunately, there is no filtering when loading tests in a project file. Nice idea though. |
Here is the project file. <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8EDF4429-251A-416D-BB68-93F227191BCF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DD.Net_46.Tests</RootNamespace>
<AssemblyName>DD.Net_46.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>8dc73fc5</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<!-- a couple redacted assembly references -->
<Reference Include="Nito.AsyncEx, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nito.AsyncEx.3.0.1\lib\net45\Nito.AsyncEx.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nito.AsyncEx.Concurrent, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nito.AsyncEx.3.0.1\lib\net45\Nito.AsyncEx.Concurrent.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nito.AsyncEx.Enlightenment, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nito.AsyncEx.3.0.1\lib\net45\Nito.AsyncEx.Enlightenment.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Tpl.Dataflow.4.5.24\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<!-- Can't share these files so I commented them out for you. -->
<!-- <Compile Include="DDBasicNativeMethodTests.cs" />
<Compile Include="FactoryTests.cs" /> -->
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DD.Net.Abstractions\DD.Net.Abstractions.csproj">
<Project>{55b1d427-edbe-4546-8805-ebadaed1cf86}</Project>
<Name>DD.Net.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\DD.Net_46\DD.Net_46.csproj">
<Project>{94761d8d-857b-4f11-959a-3b41236876e7}</Project>
<Name>DD.Net_46</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.9.0\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets'))" />
</Target>
<Import Project="..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" Condition="Exists('..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> And here are the nuget packages. <?xml version="1.0" encoding="utf-8"?>
<packages>
<!-- Same redacted packages -->
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net462" />
<package id="Nito.AsyncEx" version="3.0.1" targetFramework="net462" />
<package id="NUnit" version="3.6.1" targetFramework="net45" />
<package id="NUnit3TestAdapter" version="3.9.0" targetFramework="net462" />
<package id="StyleCop.MSBuild" version="5.0.0" targetFramework="net462" developmentDependency="true" />
</packages> |
After "stepping" mentally through the source code, I concluded that it should work. 😄 My best guess is that the message indicating that At the moment, I'm onto some other work so I'll leave this unassigned. |
This appears to be very similar to issue #34, which is fixed and now passes its tests correctly. See the closing comment on that issue. @glen-nicol Can you try out the dev package linked from that issue and let us know if it works for you? |
To be really sure this was resolved, I added a unit test based on your sample project file with only x86 platform. |
🎉 This issue has been resolved in version 3.9.0 🎉 The release is available on: |
I get an error when I try and run my x86 bound Nunit project with the console runner along with another Any CPU project in a solution. I specify the project files individually because when I use the solution it complains about the actual projects being portable class libraries among other things.
I can run both of these projects just fine as is with the Visual studio adapter. I also tried to run the console without the Any CPU test project and I get the same error for the .csproj. If I specify the path to the built test assembly it runs just fine.
Any ideas on why it would have trouble with a project that only has a x86 platform target?
The text was updated successfully, but these errors were encountered: