statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.65k stars 235 forks source link

Can't build API project after uninstalling VS2017 #865

Closed SilentSin closed 4 years ago

SilentSin commented 5 years ago

I recently uninstalled Visual Studio 2017 Community (because I've been using 2019 for a while now). I can still open the project in VS 2019 and build it perfectly fine, but Wyam can't build it and gives me the error below (the rest of the site still works, it just doesn't get any API pages).

I checked in Visual Studio that I still have all the .NET framework v3.5 stuff installed for and even tried reinstalling it (though it took a bit of searching because the URL at the end of the error doesn't exist).

Is this something that might be fixed by moving to Statiq (which sounds like it's getting close to release) or is there something else I can try? I could always reinstall VS 2017, but that doesn't seem like the right solution.

The error is:

Could not compile project at C:\Users\Kailas\Source\Repos\Unity\Animancer\Documentation Website\Project\Animancer.csproj Couldn't find a .NET Framework MSBuild path Started process 2496: "dotnet" --info Process 2496 exited with code 0

Started process 5080: "dotnet" "C:\Program Files\dotnet\sdk\2.2.402\MSBuild.dll" /noconsolelogger /restore /target:Clean;Build /property:ProvideCommandLineArgs="true";GenerateResourceMSBuildArchitecture="CurrentArchitecture";DesignTimeBuild="true";BuildProjectReferences="false";SkipCompilerExecution="true";DisableRarCache="true";AutoGenerateBindingRedirects="false";CopyBuildOutputToOutputDirectory="false";CopyOutputSymbolsToOutputDirectory="false";SkipCopyBuildProduct="true";AddModules="false";UseCommonOutputDirectory="true";GeneratePackageOnBuild="false";NonExistentFile="NonExistentSubDir__NonExistentFile__";SolutionDir="C:\Users\Kailas\Source\Repos\Unity\Animancer\Documentation Website\Project" /l:BuildalyzerLogger,"C:\Users\Kailas.nuget\packages\Buildalyzer.Logger.2.2.0\lib\netstandard1.3\Buildalyzer.Logger.dll";1920;False "C:\Users\Kailas\Source\Repos\Unity\Animancer\Documentation Website\Project\Animancer.csproj" The reference assemblies for .NETFramework,Version=v3.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacksProcess 5080 exited with code 1

daveaglick commented 5 years ago

Unfortunately Statiq support for API docs is still a few months away (though that will be the way to go eventually). Thankfully I think this might be an easy fix.

Wyam is currently using Buildalyzer 2.2.0, but there’s a newer version that specifically addresses future-proofing MSBuild path discovery. I can’t guarantee that’s related to the issue you’re seeing but it seems reasonable. I’ll try to get another Wyam update out later today with the latest Buildalyzer dependency and let’s see if that helps.

SilentSin commented 4 years ago

I updated to Wyam 2.2.8 but still got the same error. It did spend some time on nuget packages when I first ran the new version, but I just checked the directory where my packages are installed and it doesn't have Buildanalyzer 2.3.0, only 2.2.0 and older.

Manually downloading Buildanalyzer 2.3.0 and throwing it in the 2.2.0 directory seems to have fixed the issue, so maybe you didn't set the correct version dependency in Wyam 2.2.8 or something?

daveaglick commented 4 years ago

I just checked the directory where my packages are installed and it doesn't have Buildanalyzer 2.3.0, only 2.2.0

Probably because I still need to release Wyam 2.2.9 with an updated Buildalyzer reference 😬. Planning to look at that during my lunch break today so keep an eye out. Thanks for checking with the updated Buildalyzer though - at least we know it should work once I get the new release out.

daveaglick commented 4 years ago

Okay - 2.2.9 is up with updated Buildalyzer refs so this should be resolved on the latest version.

SilentSin commented 4 years ago

Yep, 2.2.9 works. Thanks Dave.