0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

vs2019を 単独インストールしても GenerateResource タスクが見つからない

Last updated at Posted at 2024-04-03

リソース用プロジェクト message.resource.proj

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTarget="All">
  <PropertyGroup>
    <OutDir>message.resources</OutDir>
    <SourceDirectory>..\message</SourceDirectory>
  </PropertyGroup>

  <ItemGroup>
    <ResourceText Include="$(SourceDirectory)\common.txt" />
  </ItemGroup>

  <Target Name="Build">
    <MakeDir  Directories="$(OutDir)" />

	<GenerateResource
	    Sources="@(ResourceText)"
	    OutputResources="@(ResourceText->'$(OutDir)\%(FileName).resources')">
		<Output
	        TaskParameter="OutputResources"
	        ItemName="Resources"/>
	</GenerateResource>	    
	<AL
	    EmbedResources="@(Resources)"
	    OutputAssembly="$(OutDir)\Message.Resources.dll">

	    <Output TaskParameter="OutputAssembly"
	        ItemName="SatelliteAssemblies"/>
	</AL>
  </Target>
  <Target Name="Clean">
    <RemoveDir Directories="$(OutDir)" />
  </Target>
  
</Project>

実行

msbuild message.resource.proj

出力

"C:\usr\src\craft\craft\cfw-dotnet\src\build\message.resource.proj" (既定のターゲット) (1) ->
(Build ターゲット) ->
  C:\usr\src\craft\craft\cfw-dotnet\src\build\message.resource.proj(39,2): error MSB3091: "resgen.exe" が見つからなかっ たため、または正
しい Microsoft Windows SDK がインストールされていないため、タスクが失敗しました。タスクは、レジストリ キー HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\
Windows\v8.0A\WinSDK-NetFx35Tools-x86 の値 InstallationFolder で指定された場所の下にある "bin" サブディレクトリで "resgen.exe" を探しています。次のいずれかを行
うことによって問題を解決できる可能性があります。1) Microsoft Windows SDK をインストールする。2) Visual Studio 2010 をイ ンストールする。3) 上記のレジストリ キーを正しい場所に手動で設定する
。4) 正しい場所をタスクの "ToolPath" パラメーターに渡す。

解決

PATH に以下を追加してみた

 C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\

ダメだった。

SdkToolsPath を直接指定してみた

	<GenerateResource
    SdkToolsPath="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\"
	    Sources="@(ResourceText)"
	    OutputResources="@(ResourceText->'$(OutDir)\%(FileName).resources')">
		<Output
	        TaskParameter="OutputResources"
	        ItemName="Resources"/>
	</GenerateResource>	    

うまくいった…かもしれない

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?