-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphics files in .net standard 2.0 library do have have build action of "Resource" #81
Comments
What are you trying to achieve? What platform does it work on? |
Right now it will work on windows. It has string resources and graphic resources and that's all that is in it. |
Do you have a simple repro? I'm not familiar with that item type. |
I left out the importance fact it is an image file in a folder. |
If I switch the project type from .net standard 2.0 to .net 4.7.1 then the Resource option becomes available. |
Below is an example project. The project folder has a "graphics" folder with an image foo.png. <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
<TargetFramework>net471</TargetFramework>
<AssemblyName>ImgResources</AssemblyName>
<RootNamespace>ImgResources</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\..\..\bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\..\..\bin\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.5.4" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project> |
What happens if you include |
|
When target framework is .net standard and image is included using |
Can you give me I can take a look into it. |
Thanks here they are. |
I've looked into it. As I said That said, If you want to embed the files into the assembly, you can use |
We wound up using a target of .net 471 to get this working and it is a wpf application anyway so that should work |
We have a few graphics files in .net standard 2.0 libraries, and .net 4.7.1 libraries. We are using
MSBuildSdkExtras in these libraries. All the libraries have been converted to the new project system. However, we we try to set the build action to "Resource" it
is not an available option in .net standard 2.0 libraries. I am not sure if this is an project system error or an
MSBuildSdkExtras.
The text was updated successfully, but these errors were encountered: