`Microsoft.VisualStudio.JavaScript.Sdk` is not working outside of Windows (but it can)
See original GitHub issueDescribe the bug
JavaScript MSBuild projects (.esproj
) are not working outside Windows. But it is possible to get it to work with a workaround (see below)
To Reproduce
- On Windows, follow the tutorial to create a new ASP.NET Core + RactJS (Preview) solution, as it seems that creating of such a project is impossible outside VS.
- Copy the resulting solution on the MacOS/Linux environment.
- Run dotnet build inside the solution folder.
Expected behavior
Build succeeded.
Actual behavior
/usr/local/share/dotnet/sdk/8.0.100-preview.4.23260.5/Microsoft.Common.CurrentVersion.targets(1229,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.2 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/developerpacks [/Users/seclerp/Downloads/AspNetCoreReactPreview/reactapp/reactapp.esproj]
0 Warning(s)
1 Error(s)
Workaround
Adding such a property group to a .esproj
file:
<PropertyGroup Condition=" '$(OS)' == 'Unix' " >
<FrameworkPathOverride>/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.5/mscorlib.dll</FrameworkPathOverride>
</PropertyGroup>
Fixes the issue.
Further technical details
The issue reproduces on both 8.0 preview and 7.0 SDK.
Seems like the root cause of the issue is using the default full-framework toolset for .esproj
projects which is absolutely fine on Windows environment for .NET SDK but not the case for Mac OS and Linux.
I’m interested in making PR to fix that but can’t find the sources (does JavaScript.Sdk is even open-sourced?)
Thanks.
.NET info
➜ dotnet --info
.NET SDK:
Version: 8.0.100-preview.4.23260.5
Commit: 2268e7b15c
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.3
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.100-preview.4.23260.5/
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-preview.4.23259.5
Architecture: arm64
Commit: 84a3d0e37e
.NET SDKs installed:
7.0.203 [/usr/local/share/dotnet/sdk]
8.0.100-preview.4.23260.5 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.4.23260.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.4.23259.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Issue Analytics
- State:
- Created 4 months ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
JavaScript and TypeScript in Visual Studio
Learn how Visual Studio provides rich support for JavaScript development, both using JavaScript directly, and also using the TypeScript ...
Read more >The SDK 'Microsoft.NET.Sdk' specified could not be found. ...
The SDK 'Microsoft.NET.Sdk' specified could not be found. in Visual Studio Community 2022 version 17.5 · Right-click your project > Unload ...
Read more >Troubleshoot Visual Studio installation and upgrade issues
This troubleshooting guide includes step-by-step instructions to resolve common issues with Visual Studio installation and upgrade.
Read more >Exploring JavaScript and TypeScript Development in ...
We will focus mainly on the productivity improvements including the JavaScript and TypeScript project type, project templates, code editing, ...
Read more >Installing the Visual Studio SDK
Learn about the options to install the Visual Studio Software Development Kit, including during Visual Studio installation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was moved to internal tracking (the JavaScript SDK is tracked there). We’re testing at the moment on both Linux and Mac and will probably have support in a preview of VS soon.
I’ll move this to our internal tracking systems. It aligns with the revamp we’re doing now on dotnet and esproj, so we can add it to that. Thanks! J