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

Trying to read resx files from wrong folder? #46

Closed
bjartwolf opened this issue Dec 7, 2014 · 1 comment
Closed

Trying to read resx files from wrong folder? #46

bjartwolf opened this issue Dec 7, 2014 · 1 comment

Comments

@bjartwolf
Copy link

This might just be me having configured something wrong... The project works fine locally but the resource file reader breaks when I deploy to test environments.

I am trying to figure out where the Resource type provider is finding the filepath from. Locally everything works fine, but when I deploy my project ResXProvider seems to try to read the file from a path on my buildserver. Everything works if I actually go and put the resource file in the buildpath folder, so there is only some issue with where the system tries to go and find the resource file.

System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\TeamCity\BuildAgent3\work\d15d54883fe35cc\MyProject\Resources1.resx'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Resources.ResXResourceReader.EnsureResData()
at System.Resources.ResXResourceReader.System.Collections.IEnumerable.GetEnumerator()
at Microsoft.FSharp.Collections.SeqModule.Cast@963.Invoke(Unit unitVar0)
at Microsoft.FSharp.Collections.SeqModule.revamp@914.Invoke(Unit unitVar0)
at Microsoft.FSharp.Collections.SeqModule.TryFind[T](FSharpFunc2 predicate, IEnumerable1 source)
at Microsoft.FSharp.Collections.SeqModule.Find[T](FSharpFunc2 predicate, IEnumerable1 source)
at FSharp.Configuration.ResXProvider.readValue(String filePath, String name) in l:\github\FSharp.Configuration\src\FSharp.Configuration\ResXProvider.fs:line 20

@bjartwolf
Copy link
Author

I also get the same behavior locally, it is is looking for the resource file in the source code directory. I can't publish all the source code right now, unfortunately. The only difference from your test project I can see is that I am using F# 3.1 (4.3.1.0) instead of 3.0 as the test project. I did have some issues including the resource file (I can not find a way to create Resource files from Visual Studio as in C# projects, so I ended up taking yours from the test project and changing it, which did work except for the fact that I could not change name of the resource, it had be called Resource1.resx... This might just be an issue with using resx files in F#, it doesn't seem like the tooling is that good (I am using VS2013 premium update 3)?

I am reverting to using app.config for the strings for now, but it would be nice to be able to use resource files.

vasily-kirichenko pushed a commit to vasily-kirichenko/FSharp.Configuration that referenced this issue May 11, 2018
… Nuget package is now required. Minor improvement in design-time opening of the command file.
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

1 participant