lijunle / Vsxmd

VS XML documentation -> Markdown syntax.
MIT License
215 stars 51 forks source link

Does not work with .NET Core 3.1 #74

Closed fuzzzerd closed 4 years ago

fuzzzerd commented 4 years ago

Latest nuget release does not appear to work when only the .NET Core 3.1.100 SDK is installed.

I get this error during build:

C:\Users\fuzzzerd\.nuget\packages\vsxmd\1.4.2\build\Vsxmd.targets(13,5): error MSB3073: The command "dotnet "C:\Users\fuzzzerd\.nuget\packages\vsxmd\1.4.2\build\/../tools/netcoreapp2.2/Vsxmd.dll" "bin\Debug\netcoreapp3.1\MyProj.RestApi.xml" "....\docs\MyProjAPI.md" """ exited with code -2147450730. [C:\Source\MyProj.Api\src\MyProj.RestApi\MyProj.RestApi.csproj]

Installing .NET Core 2.2 SDK seems to correct things; however, I couldn't find it documented that this package is tied to a specific .NET Core SDK being installed.

lijunle commented 4 years ago

I did not test it in .NET Core 3.1. Let me check if there are some breaking changes cause the failure.

lijunle commented 4 years ago

Update on this, .Net Core 3.1 is not working because the targets file is hard coding netcoreapp2.2 folder, which is built with .Net Core 2.2.

https://github.com/lijunle/Vsxmd/blob/a346d2931a6431c46f158e35a1006879bce693d5/Vsxmd/build/Vsxmd.targets#L8

So, when running with v3.1, it fails with

> dotnet "bin/Debug/netcoreapp2.2/../netcoreapp2.2/Vsxmd.dll" "Vsxmd.xml" "" ""
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
  - The following frameworks were found:
      3.1.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.2.0&arch=x64&rid=arch-x64

I am learning how to make side-by-side supporting on .Net Core 2.2 and 3.1.

lijunle commented 4 years ago

Hi, @fuzzzerd

Could you please check if the version 1.4.3-beta.1 resolve this issue?

I completely change the way to ship the tool - now it is built/shipped as OS-dependent binaries instead of dotnet-version-dependent DLLs. The binaries for Windows, macOS, Linux are shipped in the package. Because of this, the package size increases a lot (55MB) compared to the previous version (15KB).

fuzzzerd commented 4 years ago

I removed all of the .NET 2.2 SDKs I had installed, and upgraded my package reference to v1.4.3-beta.1 and I get the following error during build:

"The Vsxmd command is not currently available."

and no markdown file is produced.

Rolling back to v1.4.2 produces the original error again.

lijunle commented 4 years ago

@fuzzzerd Thanks for reporting! Please try 1.4.3-beta.2.

Helcaraxan commented 4 years ago

FWIW @lijunle : I ran into the same issue as reported by @fuzzzerd with 1.4.2, have just tried out 1.4.3-beta.2 and got a passing build. :+1:

lijunle commented 4 years ago

@Helcaraxan Great! I will promote it as new version.

lijunle commented 4 years ago

Version 1.4.4 is published. It is the same code as 1.4.3-beta.2.

lijunle commented 4 years ago

Oh, I made a mistake to skip the version 1.4.3. 😭

brandongregoryscott commented 4 years ago

I am still getting this error on v1.4.5 (though it has popped up recently - I've definitely used this package just fine before on the same machine)

[and-cli] Building solution (via dotnet build All.sln --no-restore)...
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  AndcultureCode.CSharp.Extensions -> /Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/bin/Debug/netstandard2.0/AndcultureCode.CSharp.Extensions.dll
  The application to execute does not exist: '/private/var/folders/8z/rpz3r0jj6pzd67jy4849mw3w0000gn/T/.net/Vsxmd/i4q3kabq.fwg/Vsxmd.dll'.
/Users/Brandon/.nuget/packages/vsxmd/1.4.5/build/Vsxmd.targets(17,5): error MSB3073: The command ""/Users/Brandon/.nuget/packages/vsxmd/1.4.5/build//../tools/osx-x64/Vsxmd" "/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.xml" "/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.md" "true"" exited with code 154. [/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.csproj]

Build FAILED.

/Users/Brandon/.nuget/packages/vsxmd/1.4.5/build/Vsxmd.targets(17,5): error MSB3073: The command ""/Users/Brandon/.nuget/packages/vsxmd/1.4.5/build//../tools/osx-x64/Vsxmd" "/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.xml" "/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.md" "true"" exited with code 154. [/Users/Brandon/acc/origin/AndcultureCode.CSharp.Extensions/src/AndcultureCode.CSharp.Extensions/AndcultureCode.CSharp.Extensions.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.82

My dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.102
 Commit:    573d158fea

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.102/

Host (useful for support):
  Version: 3.1.2
  Commit:  916b5cba26

.NET Core SDKs installed:
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.300 [/usr/local/share/dotnet/sdk]
  2.2.207 [/usr/local/share/dotnet/sdk]
  2.2.402 [/usr/local/share/dotnet/sdk]
  3.1.102 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

System info:

ProductName:    Mac OS X
ProductVersion: 10.15.5
BuildVersion:   19F101

Is there anything that might have broken on a more recent Mac update?

nikkilocke commented 3 years ago

I'm getting this, on Windows 10 with VS 2019, since I updated it to install .net core 3. Even though the code I am building is targetted at .net standard 2.2.

Running the command from the command prompt gives me:

"C:\Users\Nikki\.nuget\packages\vsxmd\1.4.5\build\/../tools/win-x64/Vsxmd.exe" "bin\Debug\net45\CodeFirstWebFramework.xml" "contentFiles/Api.md" ""
The application to execute does not exist: 'E:\Temp\.net\Vsxmd\j5o3zrbh.p0p\Vsxmd.dll'.

I tried uninstalling vsxmd, then installing 1.4.4, and the compile went through.

neman commented 3 years ago

I have the same issue as @nikkilocke, and after downgrading to 1.4.4 build went through.

SaidShah commented 3 years ago

The issue is .Net has a problem flushing the temp generated folders in the .Net folder so you have to manually delete the directories that are giving you problems from your C:\Users\Your Name\AppData\Local\Temp\.net folder and they will be regenerated when you build the project

wintondeshong commented 3 years ago

The issue is .Net has a problem flushing the temp generated folders in the .Net folder so you have to manually delete the directories that are giving you problems from your C:\Users\Your Name\AppData\Local\Temp\.net folder and they will be regenerated when you build the project

This resolved the issue for me on Windows 10 (using CLI)

camilohe commented 1 year ago

I'm getting the same error on Windows 10 with VS 2022 after upgrading a .net 3.1 project to 6.0. It uses vsxmd 1.4.5 and was building OK and generating docs while on .net 3.1. After upgrading it to .net 6.0 the build fails with the error below:

Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
  Task "Exec"
    "C:\Users\estevc\.nuget\packages\vsxmd\1.4.5\build\/../tools/win-x64/Vsxmd.exe" "CRS.Tools.Obfuscator.xml" "" ""
     The application to execute does not exist: 'C:\Users\estevc\AppData\Local\Temp\.net\Vsxmd\j5o3zrbh.p0p\Vsxmd.dll'.

I tried uninstalling and reinstalling vsxmd 1.4.5, cleaning the build and removing the bin/obj folders manually but the issue persists.

Deleting the temp folder 'C:\Users\estevc\AppData\Local\Temp\.net\Vsxmd\j5o3zrbh.p0p and running dotnet clean; dotnet build fixed the issue for me.

camilohe commented 2 weeks ago

I started getting the same error on Windows 10 with VS 2022 after upgrading a .net 6.0 project to 8.0. Wasted hours trying to fix it, then found my old solution above. It still works!