madskristensen / Tweakster

A Visual Studio extension
Apache License 2.0
241 stars 23 forks source link

CRITICAL: After installing Tweaker my projects will not build #11

Closed ghost closed 4 years ago

ghost commented 4 years ago

@madskristensen

After installing Tweaker my projects will not build. It seems that the project.assets.json file is required, so when the obj folder is deleted (cleaned up properly), the build fails because upstream build actions require it.

To get the solution to build, I have to restore NuGet packages and then BUILD not REBUILD.

For now, I'll have to disable. Not sure why I'm seeing this as the extension is mature.

Severity Code Description Project File Line Suppression State Error NETSDK1004 Assets file 'C:\Code\vs2019\Amrock\CustomerApi\CustomerApi\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. CustomerApi C:\Program Files\dotnet\sdk\3.1.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234

madskristensen commented 4 years ago

You can disable this particular feature of Tweaks from the settings as shown here: https://github.com/madskristensen/Tweakster#settings

What type of project do you see this happening in?

madskristensen commented 4 years ago

What makes this a bit strange is that your build relies on something inside /obj folder. That folder is never added to source control, so anybody cloning the repo wouldn't be able to build...

ghost commented 4 years ago

@madskristensen .NET CORE 3.1 ASP.NET Web API (single project in the solution)

Yes, totally agree on the file location.

After cloning, VS will perform the NuGet restore so the file will be there.

W/O Tweaks, never had the issue.

With Tweaks it's doing a great job but conflicting with the project build expectations.

Maybe we can scale it back to only perform on the CLEAN command and not REBUILD?

ghost commented 4 years ago

@madskristensen I did a rebuild using your awesome Diagnostic Setting for the output window. I've attached the results.

UPDATED ATTACHMENT AFTER ENABLING TWEAKS

I was trying to find where the build process restores NuGet packages or at last checks them, and then when Tweaks performs its cleanup. I'm not really up on MS Build. But may this can help.

Suggestion. Extension to save the nice colored data from the output window to an HTML, or MarkDown file for sharing and reading.

RebuildOutput-V2.txt

ghost commented 4 years ago

@madskristensen I've correct the above by enabling Tweaks and rebuilding so that the output text from a failed build is correct now.

ghost commented 4 years ago

@madskristensen I'm thinking that the build pipeline must check for the file from /obj and if it's not there, causes a NuGet restore to occur. If you remove /obj after this check, build errors occur. Any way Tweaks can be first in line inside the pipeline? Just a thought.

madskristensen commented 4 years ago

Thanks. I think you're right, that the safest would be to only delete on Clean and not on Rebuild