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 #550

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

Comments

@muratg
Copy link

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

This comment has been minimized.

Copy link
Author

commented Dec 18, 2015

From @davidfowl on November 23, 2015 6:47

/cc @kirthik

@muratg

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented Dec 18, 2015

From @kirthik on November 23, 2015 18:45

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

@onovotny

This comment has been minimized.

Copy link
Member

commented Jan 30, 2016

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

@davidfowl

This comment has been minimized.

Copy link
Collaborator

commented Jan 31, 2016

@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).

@onovotny

This comment has been minimized.

Copy link
Member

commented Jan 31, 2016

Thanks for the update @davidfowl

@TheRealPiotrP

This comment has been minimized.

Copy link
Contributor

commented May 20, 2016

@onovotny is this still an issue?

@onovotny

This comment has been minimized.

Copy link
Member

commented May 20, 2016

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

@blackdwarf

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2016

Based on the comment above, will close this.

@blackdwarf blackdwarf closed this Jul 22, 2016
@onovotny

This comment has been minimized.

Copy link
Member

commented Jul 22, 2016

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

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2016

@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.

@onovotny

This comment has been minimized.

Copy link
Member

commented Jul 22, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.