Reputation: 65
Recently, I decided to update my program and decided to add the ability to change the language to it. For this, I created .resx files and filled in with data. When trying to compile I got some error related to "AL.exe". After installing the Windows SDK, the error was fixed. Unfortunately, now there was another error when trying to compile:
The task "GenerateResource" has failed unexpectedly.
System.NotSupportedException: The format of the given path is not supported.
w System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
w System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
w System.IO.FileInfo.Init(String fileName, Boolean checkHost)
w System.IO.FileInfo..ctor(String fileName)
w Microsoft.Build.Tasks.SdkToolsPathUtility.FileExists(String filePath)
w Microsoft.Build.Tasks.SdkToolsPathUtility.GeneratePathToTool(FileExists fileExists, String currentArchitecture, String sdkToolsPath, String toolName, TaskLoggingHelper log, Boolean logErrorsAndWarnings)
w Microsoft.Build.Tasks.GenerateResource.ComputePathToResGen()
w Microsoft.Build.Tasks.GenerateResource.Execute()
w Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
w Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() (MSB4018)
Compilation is successful only if I remove all .resx files from the project. Not only those created by me, but also those generated automatically from UI.
I tried to rebuild the project, clean the project, deleted the bin and obj folders.
There isn't any ":" sign anywhere in the filenames.
Deleting dots from filenames also doesn't help :/
How can I resolve my problem?
Upvotes: 1
Views: 945
Reputation: 65
I solved my problem! My problem was the path of the TargetFrameworkSDKToolsDirectory
environment variable.
The value of my environment variable was TargetFrameworkSDKToolsDirectory=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools
, but the correct value is
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools
.
The TargetFrameworkSDKToolsDirectory
environment variable should be added as user variable instead of system variable.
Upvotes: 2
Reputation: 89
The following documentation in Work with .resx files programmatically may help:
Convert .resx files to binary .resources files Converting .resx files to embedded binary resource (.resources) files has significant advantages. Although .resx files are easy to read and maintain during application development, they are rarely included with finished applications. If they are distributed with an application, they exist as separate files apart from the application executable and its accompanying libraries. In contrast, .resources files are embedded in the application executable or its accompanying assemblies. In addition, for localized applications, relying on .resx files at run time places the responsibility for handling resource fallback on the developer. In contrast, if a set of satellite assemblies that contain embedded .resources files has been created, the common language runtime handles the resource fallback process.
To convert a .resx file to a .resources file, you use Resource File Generator (resgen.exe),
resgen.exe is described here:
Resgen.exe (Resource File Generator)
Upvotes: 0
Reputation: 18013
I think the IDE/compiler is complaining because your satellite resource files don't have a main resource file. Try to create a "resource.resx" file in the Resources folder.
Upvotes: 0