admin管理员组文章数量:1401958
I've written a pair of .xaml/.targets file to handle the compilation of pixel shaders in WPF.
This is my xaml file:
<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns=";
xmlns:x=";
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ItemType Name="EffectShader"
DisplayName="Wpf ShaderEffect Shader Compiler"
/>
<ContentType Name="EffectShaderContent"
ItemType="EffectShader" />
<FileExtension Name="*.fx"
ContentType="EffectShaderContent" />
</ProjectSchemaDefinitions>
and this is my .targets file:
<?xml version="1.0" encoding="utf-8" ?>
<Project>
<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xaml" />
<AvailableItemName Include="EffectShader">
<Targets>EffectsShadersCompilation</Targets>
</AvailableItemName>
</ItemGroup>
<Target Name="EffectsShadersCompilation"
Condition="@(EffectShader)!=''"
BeforeTargets="CoreCompile">
<MakeDir Directories="$(IntermediateOutputPath)%(EffectShader.RelativeDir)"
Condition="!Exists('$(IntermediateOutputPath)%(EffectShader.RelativeDir)')"/>
<Exec Command=""$(WINSDK)/x64/fxc.exe" %(EffectShader.Identity) /T ps_3_0 /E PSmain /O3 /Fo$(IntermediateOutputPath)%(EffectShader.RelativeDir)%(EffectShader.Filename).ps"
Outputs="$(IntermediateOutputPath)%(EffectShader.RelativeDir)%(EffectShader.Filename).ps">
<Output ItemName="CompiledEffectShader"
TaskParameter="Outputs" />
</Exec>
<ItemGroup>
<Resource Include="@(CompiledEffectShader)" />
</ItemGroup>
</Target>
</Project>
This works fine and all, but when I want to access the properties of any of the EffectShader
files, the properties are empty.
I just want to show something like in other files like this:
But MSBuild is like an undocumented mess for me. Can anybody help me telling what's missing?
Thanks in advance.
This is .csproj file
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../ShadersCompilation.targets" />
<PropertyGroup>
<TargetFramework>net9.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<Authors>DrkWzrd</Authors>
<Version>0.8.62</Version>
<FileVersion>0.8.65</FileVersion>
<AssemblyVersion>0.8.65</AssemblyVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>Variety of several extensions and tooling for wpf</Description>
<NeutralLanguage>en-US</NeutralLanguage>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<RootNamespace />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<ShouldCreateLogs>False</ShouldCreateLogs>
<AdvancedSettingsExpanded>True</AdvancedSettingsExpanded>
<UpdateAssemblyVersion>False</UpdateAssemblyVersion>
<UpdateAssemblyFileVersion>False</UpdateAssemblyFileVersion>
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
<UpdatePackageVersion>True</UpdatePackageVersion>
<AssemblyInfoVersionType>SettingsVersion</AssemblyInfoVersionType>
<InheritWinAppVersionFrom>None</InheritWinAppVersionFrom>
<PackageVersionSettings>AssemblyVersion.IncrementWithAutoReset.None</PackageVersionSettings>
</PropertyGroup>
<ItemGroup>
<Compile Remove="System\Windows\Media\Imaging\QuadDistort.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tools" Version="1.7.41" />
</ItemGroup>
<ItemGroup>
<Compile Update="LibraryMessages.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>LibraryMessages.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="LibraryMessages.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>LibraryMessages.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="../PushToGitHub.targets" />
</Project>
本文标签: visual studioMSBuild ItemType and custom Build Action doesn39t work as expectedStack Overflow
版权声明:本文标题:visual studio - MSBuild ItemType and custom Build Action doesn't work as expected - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744285043a2598838.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论