Skip to content
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

copy_local: false has no effect when opening .NET SDK projects with VS2017 #3352

Closed
atlemann opened this issue Sep 7, 2018 · 3 comments · Fixed by #3356
Closed

copy_local: false has no effect when opening .NET SDK projects with VS2017 #3352

atlemann opened this issue Sep 7, 2018 · 3 comments · Fixed by #3356

Comments

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

Description

When using the new .NET SDK project format, setting copy_local: false for a package does not work as expected when opening the project in VS2017.

Repro steps

In a new empty directory, create a new F# project

dotnet new classlib -lang f#
dotnet new sln
dotnet sln add *.fsproj

Edit the project file and replace netstandard2.0 with net462

<TargetFramework>net462</TargetFramework>

Invoke

paket init

Edit paket.dependencies (note copy_local: false)

framework: net462
source https://www.nuget.org/api/v2
nuget Argu copy_local: false

Edit paket.references

Argu

Invoke

paket install

Now open the project in VS2017 and build from there.

The problem is that VS2017 generates the project.assets.json when opening the project and that seems to ignore the ExcludeAssets tag.

Expected behavior

Argu.dll not to appear in the bin folder

Actual behavior

Argu.dll does appear in the bin folder

Known workarounds

Delete the obj folder and don't open the solution in VS and build with dotnet build instead.

However, if you open the solution in VS2017 afterwards, the project.assets.json is changed and things are broken again (it fills in the runtime asset).

@atlemann atlemann changed the title copy_local: false has no effect with .NET SDK when using VS2017 copy_local: false has no effect when using .NET SDK projects with VS2017 Sep 7, 2018
@atlemann
Copy link
Contributor Author

atlemann commented Sep 7, 2018

Even if I first do dotnet restore and project.assets.json is correct, opening the project in VS2017 overwrites the project.assets.json file and changes the runtime asset. The problem is that I'm i a gigantic C# solution, so VSCode is not an option. Maybe Rider.

@atlemann
Copy link
Contributor Author

atlemann commented Sep 7, 2018

If I add the ExcludeAssets tag in the {projectfilename}.paket.props file inside the obj folder, delete the project.assets.json file and then open the project in VS2017, things work as expected.

<PackageReference Include="Argu">
    <Version>5.1</Version>
    <ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>

@atlemann atlemann changed the title copy_local: false has no effect when using .NET SDK projects with VS2017 copy_local: false has no effect when opening .NET SDK projects with VS2017 Sep 7, 2018
@atlemann
Copy link
Contributor Author

Kind of related: #3186
Seems like settings for a package in paket.references files aren't taken into consideration with New SDK regardless of using dotnet CLI or VS2017.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant