Problem with Resgen when building a plugin

Dear all,

I am experiencing a problem when I want to build my plugin: I keep getting the following error message:

Error 1 Failed to locate ResGen.exe and unable to compile plug-in resource file 'C:\Users\lp50922\documents\visual studio 2013\Projects\EPO_446_CreateStudioProject\EPO_446_CreateStudioProject\PluginResources.resx' EPO_446_CreateStudioProject

I know that the Resgen is available and working because it is used in other (non-SDL) projects I am building, e.g. this one, which is also based on .Net Framework 4.0:

1>CoreResGen:

1>  "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.CSharp.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.DataSetExtensions.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Deployment.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" /compile Properties\Resources.resx,obj\Debug\testResGen40.Properties.Resources.resources

1>  Processing resource file "Properties\Resources.resx" into "obj\Debug\testResGen40.Properties.Resources.resources"

 

Is there any reference in the plugin template which redirect Visual Studio to another location where it cannot find the Resgen.exe file?

Can anyone give me a good hint on this one? I am a bit blocked since I do not know what is going wrong and what prevents me of building my Plugin.

 

Thanks in advance for your support.

 

Regards,

 

Laurent

Parents Reply
  • Hi Laurent,

    The registry key depends a bit on your os version and machine configuration. In order to properly understand where msbuild is looking and not founding the resgen.exe I suggest to run msbuild directly and not from Visual Studio. For information Visual Studio doesn't build the projects it actually rely on the msbuild tool. To run the project manually you can do the following:

    1. Open command line
    2. run the following command "{PathToMsbuild}/MSBuild.exe {PathToCSProj}/Plugin.csproj -fl -flp:logfile="{PathToLogFile}/error_log.log";verbosity=diagnostic"
    3. PathToMbuild can be found using this information- https://github.com/microsoft/vswhere/wiki/Find-MSBuild
    4. This should fail with the same error
    5. Search for the error_log.log in the location you specified
    6. Search for "Failed to locate ResGen.exe"
    7. Above you should find the keys msbuild tried to use.
    8. Verify each key for the InstallationFolder if it exists or if it does if resgen.exe is actually in there.
    9. Replace with a path that has resgen.exe, probably from the 4.7.2  SDK folder. 
Children