{"action":"created","issue":{"url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/107","repository_url":"https://api.github.com/repos/oleg-shilo/cs-script","labels_url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/107/comments","events_url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/107/events","html_url":"https://github.com/oleg-shilo/cs-script/issues/107","id":303088128,"number":107,"title":"//css_resource fails to resolve relative paths","user":{"login":"maettu-this","id":24897735,"avatar_url":"https://avatars3.githubusercontent.com/u/24897735?v=4","gravatar_id":"","url":"https://api.github.com/users/maettu-this","html_url":"https://github.com/maettu-this","followers_url":"https://api.github.com/users/maettu-this/followers","following_url":"https://api.github.com/users/maettu-this/following{/other_user}","gists_url":"https://api.github.com/users/maettu-this/gists{/gist_id}","starred_url":"https://api.github.com/users/maettu-this/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maettu-this/subscriptions","organizations_url":"https://api.github.com/users/maettu-this/orgs","repos_url":"https://api.github.com/users/maettu-this/repos","events_url":"https://api.github.com/users/maettu-this/events{/privacy}","received_events_url":"https://api.github.com/users/maettu-this/received_events","type":"User","site_admin":false},"labels":[{"id":312118166,"url":"https://api.github.com/repos/oleg-shilo/cs-script/labels/defect","name":"defect","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T12:57:48Z","updated_at":"2018-03-08T09:51:59Z","closed_at":null,"author_association":"NONE","body":"Here's the situation using standard settings:\r\n```\r\ncscs.exe .\\ProjectWithResources\\MyScripts\\Script.cs\r\nError: Specified file could not be compiled.\r\n\r\nSystem.ApplicationException: Cannot compile resources: ResGen : error RG0000: Couldn't find input file \"C:\\Users\\<User>\\AppData\\Local\\Temp\\CSSCRIPT\\Cache\\-1741293711\\.\\FormWithResources.resx\"\r\n1 error(s).\r\n\r\n   at csscript.CSSUtils.CompileResource(String file, String out_name)\r\n   at csscript.CSExecutor.Compile(String scriptFileName)\r\n   at csscript.CSExecutor.ExecuteImpl()\r\n```\r\n\r\nSame situation when explicitly compiling to a .dll file:\r\n```\r\ncscs.exe -c:0 -out:.\\ProjectWithResources\\MyScripts\\Script.dll .\\ProjectWithResources\\MyScripts\\Script.cs\r\nError: Specified file could not be compiled.\r\n\r\nSystem.ApplicationException: Cannot compile resources: ResGen : error RG0000: Couldn't find input file \"C:\\Users\\<User>\\AppData\\Local\\Temp\\CSSCRIPT\\Cache\\-1741293711\\.\\FormWithResources.resx\"\r\n1 error(s).\r\n\r\n   at csscript.CSSUtils.CompileResource(String file, String out_name)\r\n   at csscript.CSExecutor.Compile(String scriptFileName)\r\n   at csscript.CSExecutor.ExecuteImpl()\r\n```\r\nHere's the project:\r\n[ProjectWithResources.zip](https://github.com/oleg-shilo/cs-script/files/1789193/ProjectWithResources.zip)\r\n\r\nNote that `\\Properties\\Resources.resx` is properly compiled into `\\Properties\\Resources.resources` (`//css_resource ..\\Properties\\Resources.resx, ..\\Properties\\Resources.resources;` in `\\MyScripts\\Script.cs`).\r\n\r\nBut compilation of `FormWithResources.resx` failes. Looks like `//css_resource` path resolution has an issue with redirection from `\\MyScripts\\Script.cs` to `\\MyForms\\FormWithResources.cs` to `FormWithResources.resx`."},"comment":{"url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/comments/371437144","html_url":"https://github.com/oleg-shilo/cs-script/issues/107#issuecomment-371437144","issue_url":"https://api.github.com/repos/oleg-shilo/cs-script/issues/107","id":371437144,"user":{"login":"maettu-this","id":24897735,"avatar_url":"https://avatars3.githubusercontent.com/u/24897735?v=4","gravatar_id":"","url":"https://api.github.com/users/maettu-this","html_url":"https://github.com/maettu-this","followers_url":"https://api.github.com/users/maettu-this/followers","following_url":"https://api.github.com/users/maettu-this/following{/other_user}","gists_url":"https://api.github.com/users/maettu-this/gists{/gist_id}","starred_url":"https://api.github.com/users/maettu-this/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maettu-this/subscriptions","organizations_url":"https://api.github.com/users/maettu-this/orgs","repos_url":"https://api.github.com/users/maettu-this/repos","events_url":"https://api.github.com/users/maettu-this/events{/privacy}","received_events_url":"https://api.github.com/users/maettu-this/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T09:51:59Z","updated_at":"2018-03-08T09:51:59Z","author_association":"NONE","body":"Thanks for quick evaluation and fix! Also thanks for the hint on the optional second part of the `//css_resource` directive. By the way, `CSScript.chm` section `Using Resources` simply states `//css_resource <file>;` though it rather is `//css_resource <resourceFile>[ <compiledFile>];`.\r\n\r\nRegarding the inconsistencies:\r\n\r\nThe attached reduced project may not require `..\\Properties\\Resources.resx`, but if a project contains overall resources (icons, strings,...) it does require it.\r\n\r\nAlso, my project requires that the compiled resource file name explicitly contains the `<FullNamespace>`, i.e.:\r\n`//css_resource ..\\Properties\\Resources.resx, ..\\Properties\\<Project>.Properties.Resources.resources;`\r\n\r\nOtherwise a runtime error will be thrown:\r\n```\r\n    System.Resources.MissingManifestResourceException: Für die angegebene Kultur oder die neutrale Kultur konnten keine Ressourcen gefunden werden. Stellen Sie sicher, dass <FullNamespace>.FormWithResources.resources beim Kompilieren richtig in die Assembly Script eingebettet wurde, oder dass die erforderlichen Satellitenassemblys geladen werden können und vollständig signiert sind.\r\n    Stack:\r\n        bei System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n        bei System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n        bei System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n        bei System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)\r\n        bei <FullNamespace>.FormWithResources.InitializeComponent() in <Workspace>\\FormWithResources.Designer.cs:Zeile 74.\r\n        bei <FullNamespace>.FormWithResources..ctor() in <Workspace>\\FormWithResources.cs:Zeile 81.\r\n        bei <Project>.Script.Main() in <Workspace>\\Script.cs:Zeile 118.\r\n```\r\nThe message says something like \"Could not find resources for the given or neutral culture. Ensure that `<FullNamespace>.FormWithResources.resources` has been correctly embedded into the assembly script, or the required satalite assemblies have been loaded and are properly signed.\".\r\n\r\nSeems as if the Visual Studio Designer has some additional requirements or constraints regarding the resource file names."}}
{"actor":{"display_login":"maettu-this"}}