Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

XUnit simple VS 2017 Project failed to Build
mircotoepfer
#1 Posted : Saturday, September 29, 2018 7:24:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Hello,

i have a problem with .NET core 2.1x ... Not even the project template for xunit test is build and running. I thought it's a problem in my laptop configuration so i bought a new one after i spend weeks to find the problem. Now i have a complete new windows 10 laptop with new installed vs2017 enterprise and the last version of ncrunch. I creted a new xunit project from the template. Not even this is building. I installed the last version of .net core and i got the same error.

I get the error:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\Program Files\dotnet\sdk\2.2.100-preview2-009404\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets (202, 5): Das Paket "xunit.analyzers", Version 0.10.0, wurde nicht gefunden. Möglicherweise wurde es nach der NuGet-Wiederherstellung gelöscht. Andernfalls wurde die NuGet-Wiederherstellung aufgrund von Beschränkungen der maximalen Pfadlänge eventuell nur teilweise abgeschlossen.

The xunit.analyzers", Version 0.10.0 is missing ? Why?

VS and the VSTS Build pipeline builds the project without any error.

Any ideas?

Mirco
Remco
#2 Posted : Saturday, September 29, 2018 11:54:56 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Mirco,

Thanks for sharing this problem.

Without having the exact same setup on my end, I'll need to start with a guess here. I can see from the error and from the log you submitted that this project appears to be targeting netcoreapp2.2, which is still in a preview state. Most probably there's a toolset clash happening on your machine that is related to the preview. Could you try retargeting the project to netcoreapp2.1 to see if this makes any difference?

We haven't yet done any testing with NCrunch on netcoreapp2.2, but that doesn't mean that the clash is necessarily with NCrunch. It could also be related to the version of Xunit you're using. I note that the dependency on this version of xunit.analyzers seems to have been introduced in the 2.4.1 build of Xunit, which is also still in a preview state.
mircotoepfer
#3 Posted : Sunday, September 30, 2018 6:58:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Hello,

the error comes direct after new installation of visual studio and nrcrunch. The Framework 2.1.402 installes VS Studui during the installation process. I use ncrunch 3.20.0.6

Well, i deinstalled the preview version and reinstalled the 2.1.402 version. I created a new XUnit Testproject from Template and enabled ncrunh.

Result: NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\..\..\..\..\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets (198, 5): Das Paket "xunit.analyzers", Version 0.7.0, wurde nicht gefunden.

XUnit Version 0.7.0 is missing. The project build in visual studio and vsts. The vs testrunner including live unit testing works also. Only ncrunch does not work.

Quote:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="xunit" Version="2.3.1" />.
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>

</Project>



Now i upgrated the xunit version and added manually the analyzers...

Error Message: NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\..\..\..\..\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets (198, 5): Das Paket "xunit.analyzers", Version 0.10.0, wurde nicht gefunden.

Quote:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>

Remco
#4 Posted : Sunday, September 30, 2018 12:06:39 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for sharing these extra details. I've tried to reproduce this problem as per your instructions, but it doesn't seem to surface for me. This suggests that there is a variable in your environment causing the problem. To understand it, we're going to need to dig a bit deeper.

You mentioned that you've just upgraded your Visual Studio. Can you confirm which version you are running? Is this a preview version?

I'd like to ask you to follow a few steps here to obtain some more information. I apologise if this seems excessive, but right now the fastest way to understand and resolve this problem is to collect as much data as possible about the behaviour of your build system. Could you please do the following?

- Open up the same sample project you've just described to me, turn on NCrunch and watch it fail
- Right click on the failed project build in the Tests Window, go to Advanced->Browse to workspace
- Find the generated .csproj file in the workspace that represents NCrunch's shadowed version of your project file
- Open a command prompt to the location of the .csproj file, then run MSBuild.exe against it with the following command line (msbuild can usually be found in a location like C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin):
msbuild /v:Diagnostic > build.log
- Create a ZIP file of the entire directory containing the generated .csproj file and the new build.log file, including all subdirectories (bin/obj).

Now we also need the build data for the foreground solution.

- Close your IDE
- Browse to the directory containing your sample project (not the NCrunch workspace)
- Delete the bin directory
- Run MSBuild against the project file as such:
msbuild /v:Diagnostic > build.log
- Create a ZIP file of your sample project along with the new build.log file. Be sure to include the obj directory and project.assets.json file.

- Submit both ZIP files through the NCrunch contact form.
mircotoepfer
#5 Posted : Monday, October 1, 2018 4:51:35 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Hello...

VS Studio Information:

Quote:

Microsoft Visual Studio Enterprise 2017
Version 15.8.5
VisualStudio.15.Release/15.8.5+28010.2036
Microsoft .NET Framework
Version 4.7.03056

Installed Version: Enterprise

Application Insights Tools for Visual Studio Package 8.13.10627.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.8.05085.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 15.8.31590
Provides languages services for ASP.NET Core Razor.

ASP.NET Web Frameworks and Tools 2017 5.2.60618.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.8.05023.0
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 15.8.05023.0
Azure Functions and Web Jobs Tools

C# Tools 2.9.0-beta8-63208-01
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service 2.0
JavaScript Language Service

JavaScript Project System 2.0
JavaScript Project System

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.10730.2

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NCrunch
Continuous Testing Tool for .NET
Copyright © 2010-2018 Remco Software Ltd

Node.js Tools 1.4.20907.4 Commit Hash:f048d52e417a8902dea9e42828b7fdab92d4aaaa
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 15.1.61808.07020
Microsoft SQL Server Data Tools

Syntax Visualizer 1.0
An extension for visualizing Roslyn SyntaxTrees.

TypeScript Tools 15.8.20822.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 2.9.0-beta8-63208-01
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: 55a3dc3231c95c77f81ee53f7d29152029da7408.
Microsoft Visual F# Tools 10.2 for F# 4.5

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers


You should received my buld results via contact form.

Mirco
mircotoepfer
#6 Posted : Monday, October 1, 2018 8:05:21 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Additional Information:

The Computer is connected to Azure AD
My Name has an "Öö" in the name, it looks that the character "ö" is also part of the users home path
Remco
#7 Posted : Monday, October 1, 2018 11:59:04 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
mircotoepfer;12712 wrote:

The Computer is connected to Azure AD
My Name has an "Öö" in the name, it looks that the character "ö" is also part of the users home path


I noticed this in the logs. We've seen similar things before but not in a way that has caused assembly referencing issues. Still, it's quite a major point of difference and if you have any way to test around it, I'd be interested to know if it is making any difference in the behaviour of your build.

Thanks for sending through all the detailed information. This has helped to greatly narrow the issue down, but unfortunately it couldn't give us a way to reproduce the problem. It appears that the problem only appears when NCrunch hosts MSBuild itself through the MSBuild API, and it isn't tied to any of NCrunch's special build features or workspacing. This is noticeable because the MSBuild command in your NCrunch workspace actually passed through without any problems.

There are two major differences between an NCrunch-hosted MSBuild call and the MSBuild call you did on the command line:
1. NCrunch passes several extra properties into the build to change some of its behaviour (such as turning off optimizations, setting debug symbols to Full, etc)
2. When NCrunch hosts MSBuild, it does so through the same API as used by Visual Studio. This is structurally a bit different to calling MSBuild through the command line, where it would then be in change of its own process and environment.

I've reviewed the various properties injected by NCrunch but cannot see anything I would expect could cause the problem you're experiencing. This suggests that there is a good chance the problem is actually a bug in MSBuild itself, which is quite frightening as without a way to reproduce the bug ourselves, we lack any effective means to analyse it or work around it.

The first thing I would suggest trying is changing your Build Process CPU Architecture setting to x64. Normally this defaults to x86 under NCrunch, which may be a point of difference. I don't expect this will resolve the problem but it's worth a shot.

I've also prepared a special build that includes a large amount of diagnostic information on the NCrunch build. This should help us to analyse things a bit deeper and maybe work out where the malfunction is happening. It would be great if you could install the build below and continue with the following instructions:

NCrunch_VS2017_3.21.0.5.msi
NCrunch_VS2017_3.21.0.5.msi.7z
NCrunch_VS2017_3.21.0.5.zip

- Open your IDE, go to your NCrunch configuration settings, change your 'Log Verbosity' setting to 'Detailed'
- Restart NCrunch, then wait for your build to fail
- Open the processing queue window, select the failed build in the list
- You should see a giant amount of text appear in the bottom pane
- Copy/paste this out to a text file, then ZIP it up, and send it through the (- BROKEN LINK -)NCrunch contact form[/url].
- Uninstall v3.21.0.5 (go back to the version on the NCrunch download page)
- Remove the Log Verbosity configuration setting
mircotoepfer
#8 Posted : Monday, October 1, 2018 3:26:13 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Hello,

i send you the logging information via contact form.

I could configure a azure vm with this failure just by creating a user with ö in the name.

If you want, i can send your the login.


Mirco
Remco
#9 Posted : Tuesday, October 2, 2018 12:38:36 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for the extra log.

Could you please try the following steps?

- Close your VS
- Open your local environment variable settings, create a new environment variable under the name 'NUGET_PACKAGES', set the value to 'C:\MyNugetPackages' or somewhere similar outside your local user profile directory
- Reopen VS, start NCrunch

Does this resolve the issue?
Remco
#10 Posted : Tuesday, October 2, 2018 12:52:15 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Ok, just confirming that I've now reproduced the issue at my end by redirecting my Nuget packages directory to a path containing an umlaut. I couldn't get this to fail under VS15.7. Only VS15.8. So probably it's a new regression in VS/MSBuild itself. The problem seems to be conditional on MSBuild being hosted via the MSBuild API rather than through the command line.

This isn't really something we can fix inside NCrunch itself. Most likely MS will soon be aware of this problem (if they don't know about it already), and it'll likely be fixed in a future version of MSBuild. For now, the best way to handle this is to work around it with the NUGET_PACKAGES setting.
mircotoepfer
#11 Posted : Tuesday, October 2, 2018 5:02:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/29/2018(UTC)
Posts: 6
Location: Germany

Steps in the right direction ;-)

I have changed the nuget path by setting the variable.


No it works fine, Thank you.

Please give me a hint, if you dont need the vm for diagnostics.

Mirco
Remco
#12 Posted : Tuesday, October 2, 2018 5:35:48 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks Mirco. I've tipped MS off about this problem. Hopefully they'll be able to address it. Don't worry about the VM. Now that we can produce it at will using the NUGET_PACKAGES setting, we have everything we need here.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.105 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download