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

Notification

Icon
Error

The target "NCrunchPrepareForBuild" does not exist in the project (again)
Careidas77
#1 Posted : Wednesday, September 28, 2022 1:55:06 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
After updating Nuget packages in an Azure Function v.4 project, dotnet 6, NCrunch suddenly started reporting build failures:

..\..\..\..\..\program files\microsoft visual studio\2022\professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (1154, 7): The target "NCrunchPrepareForBuild" does not exist in the project.

Seems to be the same issue as in topic https://forum.ncrunch.ne...tion---build-issue.aspx before, and the suggested workaround still works:

<PropertyGroup Condition="'$(NCrunch)' == '1'">
<ExcludeRestorePackageImports>true</ExcludeRestorePackageImports>
</PropertyGroup>

However, this was not a problem until recently with this project in question. I did update (and pay for yet another license) NCrunch, but to no avail.

Any insights?
Remco
#2 Posted : Wednesday, September 28, 2022 11:14:23 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Hi, thanks for sharing this issue.

We do now have properly considered support for Azure function projects, which we didn't have back when this was posted 3 years ago.

As such, this is supposed to work without needing to have the workaround in place.

Are you able to build us a sample project that can produce this issue? You can submit small code packages to us through the support contact form.
Careidas77
#3 Posted : Friday, September 30, 2022 6:47:10 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I will give it a try, and get back to you, but I'm not confident I will be able to reproduce the error. In the meanwhile, is there any information from the current project, configuration, target-file, whatnot that I could provide that would be of use for you in investigating the issue further?

I mean, everything used to be OK, and then suddenly one day, it just wasn't any more.

Thank you beforehand!
Remco
#4 Posted : Friday, September 30, 2022 7:08:26 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Careidas77;16291 wrote:
I will give it a try, and get back to you, but I'm not confident I will be able to reproduce the error. In the meanwhile, is there any information from the current project, configuration, target-file, whatnot that I could provide that would be of use for you in investigating the issue further?


Something that may be helpful is if you can submit a bug report via the NCrunch menu after the failure appears.

Though I don't think the bug report will give us enough info to reproduce the issue, I will take a look through it to see if anything stands out.
Careidas77
#5 Posted : Thursday, October 6, 2022 8:25:39 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Sorry for the delay in response. I've now realized that the error is reproducable:
  1. Create a blank solution (Visual Studio 2022).
  2. Create a default Azure Function project from the VS template. Make sure that it's:
    1. Dotnet 6
    2. "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated" (in local.settings.json).

  3. Enable NCrunch - note that NCrunch can build just fine.
  4. Update Nuget packages to latest version. At the time of writing, it's:
    1. Microsoft.Azure.Functions.Worker -> 1.10.0
    2. Microsoft.Azure.Functions.Worker.Extentions.Timer -> 4.1.0 (if you chose a time-trigger function from the template when creating the AF project)
    3. Microsoft.Azure.Functions.Worker.Sdk -> 1.7.0

  5. Note that NCrunch upon the next build attempt fails with the error in question:
    Quote:
    [...]\program files\microsoft visual studio\2022\professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (1154, 7): The target "NCrunchPrepareForBuild" does not exist in the project.

I can send you a project copy if you like, but it should be easy enough for you to try it yourself, I guess? I also filed a bug report through the NCrunch interface as you suggested, after the error occurs, containing the same information as above.

Please let me know if I can do anything more to help.
Remco
#6 Posted : Thursday, October 6, 2022 11:19:55 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Thanks for these extra details.

I've tried to follow your instructions but ended up with something very different. There are a range of options available under the VS Azure Function template and I'm not sure which ones you're using.

Could you upload a ZIP of the failing project?
Careidas77
#7 Posted : Monday, October 10, 2022 8:48:33 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
OK, uploaded the requested zip just now.
Remco
#8 Posted : Tuesday, October 11, 2022 8:12:44 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 932 times
Was thanked: 1259 time(s) in 1172 post(s)
Careidas77
#9 Posted : Wednesday, October 12, 2022 11:20:39 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I'll take it for a spin and report back :)
Careidas77
#10 Posted : Wednesday, October 12, 2022 11:31:38 AM(UTC)
Rank: Member

Groups: Registered
Joined: 9/28/2022(UTC)
Posts: 15
Location: Sweden

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
My problem is gone, so I conclude it's "mission accomplished" :) The test project I sent you, as well as the original project in which I first encountered the issue in question: NCrunch now runs fine in both projects again, and I no longer need the "old fix" in place to make it so. Thank you!
1 user thanked Careidas77 for this useful post.
Remco on 10/12/2022(UTC)
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.070 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download