You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to get the "Add a project reference" post action to work when creating a new project via Visual Studio if the project is outside of the template folder. Using the dotnet cli works as expected, but using Visual Studio fails to add the reference and I see errors in the Visual Studio application log like:
817 ERROR Unable to add project reference, C:\ReferenceDemo\src\ClassLibrary1\ClassLibrary1.csproj not found. AddReferencePostCreationAction -- AddReferenceToProjectFileAsync 2024/03/28 19:28:12.402
Even though that path definitely exists.
To Reproduce
Steps: Use the attached demo project
Put the ReferenceDemo folder at the root of the C:/ drive
Run dotnet pack in C:/ReferenceDemo/templates
Run dotnet new install C:/ReferenceDemo/templates/bin/Release/Templates.1.0.0.nupkg
Create a new project with the custom template via the dotnet cli (dotnet new AppTemplate). Note that the created project correctly references ClassLibrary1
Create a new project with the custom template via Visual Studio. Note that the created project does not have any project references. ReferenceDemo.zip
Product
Visual Studio
Describe The Bug
I am unable to get the "Add a project reference" post action to work when creating a new project via Visual Studio if the project is outside of the template folder. Using the dotnet cli works as expected, but using Visual Studio fails to add the reference and I see errors in the Visual Studio application log like:
817 ERROR Unable to add project reference, C:\ReferenceDemo\src\ClassLibrary1\ClassLibrary1.csproj not found. AddReferencePostCreationAction -- AddReferenceToProjectFileAsync 2024/03/28 19:28:12.402
Even though that path definitely exists.
To Reproduce
Steps: Use the attached demo project
ReferenceDemo.zip
dotnet Info
output
.NET SDK: Version: 8.0.200 Commit: 438cab6a9d Workload version: 8.0.200-manifests.e575128cRuntime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.200\
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.2
Architecture: x64
Commit: 1381d5ebd2
.NET SDKs installed:
3.1.117 [C:\Program Files\dotnet\sdk]
3.1.426 [C:\Program Files\dotnet\sdk]
8.0.200 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Version
17.9.1
Additional context
No response
The text was updated successfully, but these errors were encountered: