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

Notification

Icon
Error

ASP.NET Core 2 App tries to build *.ts files despite being excluded in config
MikeWard
#1 Posted : Wednesday, March 7, 2018 6:39:05 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/19/2011(UTC)
Posts: 33
Location: Ann Arbor, MI

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Getting acquainted with ASP.NET core. Added a single test but the main project won't build in NCrunch.

Code:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues
app\js\app.ts (8, 20): Build:Cannot find module 'mithril'.
app\js\components\page\nav-bar.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\components\page\nav-bar.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\components\page\page-footer.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\components\page\page-footer.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\components\page\page-header.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\components\page\page-header.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\components\status\loading.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\components\status\loading.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\components\widgets\grid.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\components\widgets\grid.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\pages\about.test.ts (6, 1): Build:Cannot find name 'test'.
app\js\pages\about.ts (1, 20): Build:Cannot find module 'mithril'.
app\js\pages\about.ts (16, 11): Build:Parameter 'rs' implicitly has an 'any' type.
app\js\pages\about.ts (17, 12): Build:Parameter 'rj' implicitly has an 'any' type.
app\js\pages\home.test.ts (6, 1): Build:Cannot find name 'test'.
etc....


I've excluded *.ts files in the NCrunch config but it still seems to want to build them.

The project is at https://github.com/mike-ward/SampleCore

Clone it, install Parcel (npm install -g parcel-bundler) and then run

Code:
build.cmd


in the root to get things set up. Then open in VS2017 and enable NCrunch.
Remco
#2 Posted : Wednesday, March 7, 2018 11:23:37 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this problem.

Most likely, this project is set up so that the typescript files are always compiled during a normal build. So the problem here is likely to be not that NCrunch is building them, but rather that it's failing to do so. It looks like there are dependencies that aren't being included in the NCrunch workspace. Do you have any other typescript libraries that perhaps need to be included using the 'Additional files to include' configuration setting? NCrunch should resolve most dependencies automatically, but presently there are no auto resolution features for typescript dependencies.
Der-Albert.com
#3 Posted : Thursday, March 8, 2018 10:41:52 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 209

Thanks: 11 times
Was thanked: 55 time(s) in 51 post(s)
This will block TypeScript from Compiling when running under NCrunch. Add this to the .csproj File.

Code:

<PropertyGroup Condition="$(NCrunch) == '1'">
    <TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>
MikeWard
#4 Posted : Thursday, March 8, 2018 3:19:44 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/19/2011(UTC)
Posts: 33
Location: Ann Arbor, MI

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
The PropertyGroup settings fixed the typescript issues.

Now I'm seeing unresolved in NewtonSoft.Jason

Code:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues
..\..\..\..\..\..\Program Files\dotnet\sdk\2.1.100\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets (155, 5): The "GenerateRuntimeConfigurationFiles" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.GenerateCreateSetPropertyIL(PropertyInfo propertyInfo, ILGenerator generator)
...
Remco
#5 Posted : Thursday, March 8, 2018 10:51:07 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Are you running the latest build of NCrunch? This looks like the problem introduced by VS2017.6 that we fixed in v3.13.
MikeWard
#6 Posted : Friday, March 9, 2018 3:29:40 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/19/2011(UTC)
Posts: 33
Location: Ann Arbor, MI

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
That was it. I was running second latest version. Usually, I get a pop up in VS telling me there's a new version available. Anyways, NCrunch is working again. My world is restored to its nominal order :) Thanks...
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.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download