Sdk: VS2017 Not Copying Satellite Assemblies to Proper Output Location

Created on 17 Mar 2017  路  16Comments  路  Source: dotnet/sdk

_From @thefringeninja on March 16, 2017 17:21_

I've been porting a project over to the new .csproj format. This project has a dependency on FluentValidation, which uses satellite assemblies. In VS2015, on compilation, these would be placed in their correct subfolders. VS2017 places all the satellite assemblies in the root build output folder. Since they all have the same filename, only one remains.

Minimal repro project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net46</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="FluentValidation" Version="5.5.0" />
  </ItemGroup>

</Project>

_Copied from original issue: Microsoft/msbuild#1877_

Bug

Most helpful comment

[Just making a note for search engines to pick up the following error messages.]
If you see the following error while running unit tests in VSTS:

Warning: Test Run deployment issue: an error occurred while getting satellite assemblies for deployment item
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex

then it may be caused by this issue. The workaround at https://github.com/dotnet/sdk/issues/1360#issuecomment-310157372 should fix it.

All 16 comments

_From @cdmihai on March 16, 2017 18:11_

@srivatsn This looks like an SDK issue, right?

_From @thefringeninja on March 17, 2017 14:0_

Never mind. The issue was that I was running dotnet build not dotnet publish.

_From @thefringeninja on March 17, 2017 14:27_

Spoke too soon! VS2017 and Rider will use dotnet build. Why does it behave differently than dotnet publish?

_From @AndyGerlicher on March 17, 2017 17:56_

@livarcocc can you comment on this please?

_From @livarcocc on March 17, 2017 22:36_

@dsplaisted @nguerrera can you guys comment?

Looks like a bug in CopyLocalLockFileAssemblies handling of satellites. I'll move this to SDK and investigate.

@thefringeninja Thanks for the report.

Per #1132 this only repros for me when the project defines the TargetFrameworks property.

@AArnott Thanks. I missed that subtlety in #1132. Strangely, the repro steps here for the same symptom show TargetFramework not TargetFrameworks. We'll have to look a both cases to be sure.

Probably the same issue I just filed here https://github.com/NuGet/Home/issues/5164

Repros with Humanizer. Steps in linked bug

@nguerrera we believed this is release blocker. Do you agree?
Or is there some workaround @onovotny didn't find?

I agree. I have not looked for a workaround. I plan to fix this soon.

Awesome, thanks a lot!

PR #1224 is out to fix this

Fixed by #1224

Any news on this issue? The problem stills to occur.

[Just making a note for search engines to pick up the following error messages.]
If you see the following error while running unit tests in VSTS:

Warning: Test Run deployment issue: an error occurred while getting satellite assemblies for deployment item
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex

then it may be caused by this issue. The workaround at https://github.com/dotnet/sdk/issues/1360#issuecomment-310157372 should fix it.

Was this page helpful?
0 / 5 - 0 ratings