-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PackageReferences put ref instead of lib assemblies in the BuiltProjectOutputGroupDependencies output group used by VS installer projects #9310
Comments
FYI I think this is not an issue with NuGet but rather the Visual Studio Installer Extensions SDK. Their MSBuild integration uses I've provided a workaround in Azure/azure-sdk-for-net#3699 (comment) which might potentially work similarly in this case too. |
Thanks @yirkha. I'm adding the work around here for easier access. Putting this at the end of your csproj file will get around this issue when using installer projects (requires a restart of VS):
|
Closing as per the previous comments. |
i have same problem。 |
Thanks @yirkha. Your workaround works with my setup project. |
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
We were previously using a combination of @(ReferencePath) and @(_ReferenceRelatedPaths) to determine the candidate libs to pack as private, but this was incorrect since we would still sometimes pack ref assemblies. Turns out that this is an issue that surfaced elsewhere (see NuGet/Home#9310 (comment)) which resulted in a new output group being available from the common MSBuild targets (see dotnet/msbuild#3069) that we can use instead to do this properly. Closes #263
NuGet product used: VS UI
NuGet version: 5.6.0.6489
VS version (if appropriate): 16.5
OS version: 19h1
Worked before? If so, with which NuGet version: Never worked with PackageRef, still works with Package.json
Detailed repro steps so we can see the same problem
Expected: It installs the System.ValueTuple assembly from the “lib” directory
Actual: It installs the assembly from the “ref” directory, causing runtime failures
The output group BuiltProjectOutputGroupDependencies is incorrectly populated when using a package reference to consume nuget packages that have both ref and lib versions of their assemblies. Some inital inspection of the build logs shows that with packages.config the lib version is added to the "Reference" item group, which eventually makes its way into a ReferencePath item, which gets added to BuiltProjectOutputGroupDependencies.
With PackageReference, ResolveNuGetPackageAssets adds:
So even though the lib version makes it to the bin folder through ReferenceCopyLocalPaths, the ref version is what gets added to BuiltProjectOutputGroupDependencies.
This has been reported by a few different customers, here’s a link to one of the feedback tickets: https://developercommunity.visualstudio.com/content/problem/810090/visual-studio-installer-projects-extensions-incorr.html. As we mentioned in that ticket, there’s a couple potential workarounds, but neither of them are very reliable.
The text was updated successfully, but these errors were encountered: