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

Localized resources from CSProj PCL P2P ref not resolved from XPROJ #4609

Closed
muratg opened this issue Dec 18, 2015 · 12 comments
Closed

Localized resources from CSProj PCL P2P ref not resolved from XPROJ #4609

muratg opened this issue Dec 18, 2015 · 12 comments
Milestone

Comments

@muratg
Copy link

muratg commented Dec 18, 2015

From @onovotny on November 22, 2015 19:10

I am in the middle of trying to get Humanizer tested under DNX. Humanizer is a regular PCL/Profile 259 as a CSPROJ. It has a ResX file with about 39 localized versions, so it generates about 39 <locale>\Humanizer.resources.dll files alongside its main library dll.

In the process, I created a DNX test library for Humanizer and added a reference to Humanizer. VS created a wrap/Humanizer/project.json file for it and am able to compile all of the tests. However, when I try to run them, I get tons of errors about Humanizer.resources not being found. This happens both in Test Explorer and the command line via dnx test.

You can repro this in the device-runner branch of Humanizer: https://github.com/Humanizr/Humanizer/tree/features/device-runner/src/Humanizer.Tests.Dnx

   YearsAgo(years: 2, expected: "för 2 år sedan") [FAIL]
      System.IO.FileNotFoundException : Could not find file 'Humanizer.resources'.
      Stack Trace:
           at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
           at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
           at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
           at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
           at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
           at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\Localisation\Resources.cs(22,0): at Humanizer.Localisation.Resources.GetResource(String resourceKey, CultureInfo culture)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\Localisation\Formatters\DefaultFormatter.cs(97,0): at Humanizer.Localisation.Formatters.DefaultFormatter.Format(String resourceKey, Int32 number)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\Localisation\Formatters\DefaultFormatter.cs(70,0): at Humanizer.Localisation.Formatters.DefaultFormatter.GetResourceForDate(TimeUnit unit, Tense timeUnitTense, Int32 count)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\Localisation\Formatters\DefaultFormatter.cs(40,0): at Humanizer.Localisation.Formatters.DefaultFormatter.DateHumanize(TimeUnit timeUnit, Tense timeUnitTense, Int32 unit)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\DateTimeHumanizeStrategy\DateTimeHumanizeAlgorithms.cs(113,0): at Humanizer.DateTimeHumanizeStrategy.DateTimeHumanizeAlgorithms.DefaultHumanize(DateTime input, DateTime comparisonBase, CultureInfo culture)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\DateTimeHumanizeStrategy\DefaultDateTimeHumanizeStrategy.cs(16,0): at Humanizer.DateTimeHumanizeStrategy.DefaultDateTimeHumanizeStrategy.Humanize(DateTime input, DateTime comparisonBase, CultureInfo culture)
        C:\Users\oren\Source\Git\Humanizer\src\Humanizer\DateHumanizeExtensions.cs(27,0): at Humanizer.DateHumanizeExtensions.Humanize(DateTime input, Boolean utcDate, Nullable`1 dateToCompareAgainst, CultureInfo culture)
        C:\Users\oren\source\git\Humanizer\src\Humanizer.Tests.Shared\DateHumanize.cs(32,0): at Humanizer.Tests.DateHumanize.VerifyWithDate(String expectedString, TimeSpan deltaFromBase, CultureInfo culture, DateTime baseDate, DateTime baseDateUtc)
        C:\Users\oren\source\git\Humanizer\src\Humanizer.Tests.Shared\DateHumanize.cs(19,0): at Humanizer.Tests.DateHumanize.VerifyWithCurrentDate(String expectedString, TimeSpan deltaFromNow, CultureInfo culture)
        C:\Users\oren\source\git\Humanizer\src\Humanizer.Tests.Shared\DateHumanize.cs(79,0): at Humanizer.Tests.DateHumanize.Verify(String expectedString, Int32 unit, TimeUnit timeUnit, Tense tense, Nullable`1 precision, CultureInfo culture, Nullable`1 baseDate, Nullable`1 baseDateUtc)
        C:\Users\oren\source\git\Humanizer\src\Humanizer.Tests.Shared\Localisation\sv\DateHumanizeTests.cs(104,0): at Humanizer.Tests.Localisation.sv.DateHumanizeTests.YearsAgo(Int32 years, String expected)

Copied from original issue: aspnet/dnx#3190

@muratg muratg self-assigned this Dec 18, 2015
@muratg
Copy link
Author

muratg commented Dec 18, 2015

From @davidfowl on November 23, 2015 6:47

/cc @kirthik

@muratg
Copy link
Author

muratg commented Dec 18, 2015

From @onovotny on November 23, 2015 13:13

So I can confirm that when I switch to a NuGet reference to the same version of the Humanizer package, the tests execute correctly. This appears to be a local P2P issue.

@muratg
Copy link
Author

muratg commented Dec 18, 2015

From @kirthik on November 23, 2015 18:45

Yes this is a bug. Its a dupe of - aspnet/dnx#3047

@muratg muratg removed their assignment Dec 18, 2015
@clairernovotny
Copy link
Member

Ping? This affects localization and should be a priority for RC2/RTM...

@davidfowl
Copy link
Member

@onovotny When other basic things work, we'll get to this. We're still trying to get back to a place where the basic build/test/run/debug cycle works (notice I didn't even mention publish/deploy).

@clairernovotny
Copy link
Member

Thanks for the update @davidfowl

@TheRealPiotrP
Copy link
Contributor

@onovotny is this still an issue?

@clairernovotny
Copy link
Member

I don't think so since I can run Humanizer tests with netcoreapp1.0

@blackdwarf
Copy link

Based on the comment above, will close this.

@clairernovotny
Copy link
Member

This still doesn't work btw. If I have a CPRoj PCL with resources, and I reference from an XProj, the project.fragment.lock.json does not contain the resources and things break.

@blackdwarf
Copy link

@onovotny sorry about that, I understood from your comment that it is still not an issue? However, seeing as how we are moving to csproj, I believe that work with mitigate this as well.

@clairernovotny
Copy link
Member

clairernovotny commented Jul 22, 2016

I agree that moving to csproj should/will fix this as its dependency resolution is better.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
rainersigwald pushed a commit that referenced this issue Jul 20, 2020
…610.5 (#4609)

Microsoft.Net.Compilers.Toolset
 From Version 3.7.0-1.20262.2 -> To Version 3.7.0-3.20310.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
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

No branches or pull requests

6 participants