Skip to content
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

[msbuild] warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. #3876

Closed
ajax16384 opened this issue Apr 5, 2018 · 15 comments · Fixed by #9525
Closed

[msbuild] warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. #3876

ajax16384 opened this issue Apr 5, 2018 · 15 comments · Fixed by #9525
Labels
enhancement The issue or pull request is an enhancement help wanted This is an issue or pull request where we request help from the community to fix or complete iOS Issues affecting iOS macOS Issues affecting macOS
Milestone

Comments

@ajax16384
Copy link

Steps to Reproduce

  1. Create new project "Bindings Library (iOS)"
  2. Add Native Reference to some ios framework (e.g. "Test.framework")
  3. Try build

Expected Behavior

Build with no warns

Actual Behavior

Build with warning:
[skip]Microsoft.Common.CurrentVersion.targets(3214,5): warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName.

Possible reason

msbuild file Xamarin.iOS.ObjCBinding.CSharp.targets ( https://github.com/xamarin/xamarin-macios/blob/master/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.ObjCBinding.CSharp.targets ) contains rule for PrepareNativeReferences task which use deprecated syntax

Environment

=== Visual Studio Community 2017 for Mac ===

Version 7.4.2 (build 12)
Installation UUID: e6bf2be1-b435-4d47-b39c-e45bc71bf6c3
Runtime:
	Mono 5.8.1.0 (2017-10/6bf3922f3fd) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 508010000

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Version: 2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Not Installed

=== Apple Developer Tools ===

Xcode 9.3 (14154)
Build 9E145

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: 4.2.1.28 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.9.1.24 (Visual Studio Community)
Hash: f62de472
Branch: xcode9.3
Build date: 2018-03-29 19:30:53-0400

=== Build Information ===

Release ID: 704020012
Git revision: 0d8e3f0a4d683771f17959739956fa09c7ba21e3
Build date: 2018-03-30 10:45:17-04
Xamarin addins: 958839ea56ab1e331caf7c92b6ad50fb9e6ee9d2
Build lane: monodevelop-lion-d15-6

=== Operating System ===

Mac OS X 10.13.4
Darwin 17.5.0 Darwin Kernel Version 17.5.0
    Mon Mar  5 22:24:32 PST 2018
    root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
@VincentDondain
Copy link
Contributor

Bonjour,

I could confirm the warning with the following environment (all stable): https://gist.github.com/VincentDondain/57b9b3f47019b174ee6d6f5955761097

Same warning happened with XI 11.6.1.4

Here's a simple test case: https://www.dropbox.com/s/t4dmc4kcj0f0ri4/BDLib.zip?dl=0

@VincentDondain VincentDondain added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS labels Apr 5, 2018
@VincentDondain VincentDondain added this to the Future milestone Apr 5, 2018
@spouliot spouliot added enhancement The issue or pull request is an enhancement and removed bug If an issue is a bug or a pull request a bug fix labels Apr 13, 2018
@ajax16384
Copy link
Author

to clarify: there is not build error (framework successfully links with project), just want to get warning free build

@spouliot spouliot added the macOS Issues affecting macOS label Apr 20, 2018
@spouliot
Copy link
Contributor

@ajax16384 noted, it's why it was marked as an enhancement (and not a bug)

@chamons
Copy link
Contributor

chamons commented Sep 26, 2018

This also occurs with Xamarin.Mac binding projects.

@chamons
Copy link
Contributor

chamons commented Sep 28, 2018

I believe something like this patch should work: https://git.io/fxvuG
With a test like this: https://git.io/fxvuW

However the fix does not work with xbuild, which we currently use with our tests, so if I fix this warning, I break our tests. So it's blocked until #4111 ever lands.

@viralanomaly
Copy link

It appears that #4111 is in (unless I'm misreading something). Is there any chance of this ticket proceeding?

@chamons
Copy link
Contributor

chamons commented Nov 28, 2018

Yes, and PRs are welcome if you'd like to contribute one. :)

One reason I haven't worked on this yet is that I'm doing #5167 which adds and option that changes how this is done completely.

@awattar
Copy link

awattar commented Aug 30, 2019

Any update?

@chamons
Copy link
Contributor

chamons commented Oct 4, 2019

Given the fact that this issue is still open - no.

@chamons chamons added the help wanted This is an issue or pull request where we request help from the community to fix or complete label Oct 4, 2019
@stonedreamforest
Copy link

+1

@chamons chamons self-assigned this Dec 27, 2019
@chamons
Copy link
Contributor

chamons commented Dec 27, 2019

So for future me or anyone else looking at this:

We set these in here.

https://github.com/xamarin/xamarin-macios/blob/master/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.ObjCBinding.CSharp.targets#L171

The error message suggests we could change them to Embedded directly:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3280,5): warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName. [C:\Users\chhamo\source\repos\iOS-Binding\iOS-Binding\iOS-Binding.csproj]

However, that did not work (we stopped embedding the lib). Any change here will require more understanding that a brief once over (and making sure we don't regress bindings.

@chamons chamons removed their assignment Dec 27, 2019
@GrigoriiVakhmistrov
Copy link

+1

3 similar comments
@emrsn-alexandruradu
Copy link

+1

@ibocon
Copy link

ibocon commented Jun 2, 2020

+1

@ricardocolombo
Copy link

+1

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Aug 27, 2020
…nstead of ManifestResourceWithNoCulture. Fixes dotnet#3876.

Fixes this warning:

    warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName.

There is a slight difference with regards to the warning message: the Type
metadata is set to 'Non-Resx' instead of 'Resx' (because these resources
aren't resx files).

Fixes dotnet#3876.
rolfbjarne added a commit that referenced this issue Aug 27, 2020
…nstead of ManifestResourceWithNoCulture. Fixes #3876. (#9525)

Fixes this warning:

    warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName.

There is a slight difference with regards to the warning message: the Type
metadata is set to 'Non-Resx' instead of 'Resx' (because these resources
aren't resx files).

Fixes #3876.
@ghost ghost locked as resolved and limited conversation to collaborators May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement The issue or pull request is an enhancement help wanted This is an issue or pull request where we request help from the community to fix or complete iOS Issues affecting iOS macOS Issues affecting macOS
Projects
None yet