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



Can't build any .Net Core 3 apps - "The targeting pack Microsoft.NETCore.App is not installed"
#1 Posted : Tuesday, September 8, 2020 3:27:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/15/2019(UTC)
Posts: 2
Location: Bermuda

Thanks: 1 times
Whenever I try to run NCrunch in VS with even a hello world template app the projects fail to build with this message:
System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file:
The targeting pack Microsoft.NETCore.App is not installed. Please restore and try again.
at nCrunch.Compiler.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.(Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , FilePath , String , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(EffectiveProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, VisualStudioVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFramework)

This is both for .Net Core 3.1 and 3.0. For <=2.2 it actually still seems to fail for a different reason but one thing at a time. I'm using VS 16.7.2 and NCrunch 4.4 though I just upgraded VS from 16.6.1 to see if that would fix it, the issue was also there before.

dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 3.1.401
Commit: 5b6f5e5005

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.401\

Host (useful for support):
Version: 3.1.7
Commit: fcfdef8d6b

.NET Core SDKs installed:
3.1.401 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
#2 Posted : Wednesday, September 9, 2020 12:36:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,138

Thanks: 795 times
Was thanked: 1050 time(s) in 1000 post(s)
Hi, thanks for sharing this issue.

This is definitely an install state issue of some kind. It's not clear to me why the MSBuild instance hosted under NCrunch can't find this targeting pack while VS can, but there must be a connection somewhere in your toolset that is missing or not right. The tricky part will be finding it.

First, check to make sure the installation paths of your .NET Core runtimes actually have the right assemblies in them (we've had issues before with empty install paths after updating VS). If you haven't tried this already, please re-run the installer for the version of .NET Core that you are using.

Then, try installing the x86 variant of this version of .NET Core. It ships in two variants, and it's possible that MSBuild is trying to find the one that isn't installed.

Finally, if the above doesn't work, could you try submitting a bug report after the project load has failed? Maybe the log can tell us something useful.
1 user thanked Remco for this useful post.
AdamJ on 9/11/2020(UTC)
#3 Posted : Friday, September 11, 2020 11:29:31 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/15/2019(UTC)
Posts: 2
Location: Bermuda

Thanks: 1 times
Thanks Remco - installing the x86 version of .Net Core along with the x64 one fixed my issue.
#4 Posted : Friday, September 11, 2020 12:51:12 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,138

Thanks: 795 times
Was thanked: 1050 time(s) in 1000 post(s)
AdamJ;14969 wrote:
Thanks Remco - installing the x86 version of .Net Core along with the x64 one fixed my issue.

Good to hear! If you want to force NCrunch to use the x64 version, just set your Build Process CPU Architecture project-level NCrunch config setting to 'x64'.
Users browsing this topic
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.046 seconds.