63

I am new to Xamarin platform, and am facing the error

Build action 'EmbeddedResource' is not supported by one or more of the project's targets. Am debugging in emulator 8.1 for windows phone, and my project is a Xamarin.form(portable).

2

11 Answers 11

75

Follow these steps:

  1. Update Xamarin.Forms from Nuget Package Manager
  2. Close Solution And Open In Run As Administrator mode
  3. Clean And Rebuild Solution.Now Try To Deploy Project
Sign up to request clarification or add additional context in comments.

4 Comments

this worked for me except instead of step 2, I unloaded the project and reloaded it. I did not have to shut down VS or close the solution. May be a faster fix for someone in the future
Worked for me, after many cycles of updating, closing, opening VS... Also, stay away from Xamarin.Forms 2.5.xxx, completely unusable.
I've found that youe have to do this A MILLION OR SO TIMES to even get a basic program compiled (by chimps for chumps)
If you also get missing Nuget package errors, you will want to remove the EnsureNuGetPackageBuildImports node in the csproj. This is an old issue with Xamarin that has to do with the limitations of packages.config
46

Right click on your project (which is cross-platform probably), from the Project menu, do UNLOAD PROJECT and then RELOAD PROJECT, and rebuild, the errors will all be gone.

Comments

7
  1. Clean the solution
  2. Update the Xamarin.forms nuget package
  3. Restart VS
  4. Re-build the project

2 Comments

I had to open the offending pages after rebuilding the solution and individual compile the projects but you did help. Thank you.
@DaveFriedel No problem :) I get this randomly a few times a month, hopefully, they sort it out when Xamarin 3.0 released
2

For Android, make sure your Target device uses the same Platform set on 'Target Framework' on Application Settings.

[Target for the Application[1]

You can add new platforms in the SDK Manager.

Comments

1

open solution on VS with administrator mode and rebuild each one by one.

Comments

1

Also was receiving this when the Windows path was over 260 characters with fully qualified file name. Look in the output of the build and if you see a message about file length over 260, move your project to shorter directory path.

Comments

1

Option 1:

  1. Update Xamarin.Forms from Nuget Package Manager
  2. Close Solution Open In Run As Administrator mode.
  3. Clean And Rebuild Solution

In case it does not work, please follow option 2:

  1. Close Solution And Open In Run As Administrator mode.
  2. Re-install Xamarin.Forms from Nuget Package Manager
  3. Clean And Rebuild Solution

Comments

0

Go to the android project-> click right >properties> select Application-> select compile using Android version (6/5/4...etc) -> then save and rebuilt and run.

Comments

0

Upgrade VS to Visual Studio 2015 Update 3

Comments

0

I recently faced the same error in the following situation (Xamarin.Android + .NET Standard Library (converted from a PCL)):

I had some classes in a .NET Standard project that had Data Annotations for public types. I installed the nuget package that contained the Data Annotations in my .NET Standard Library. Installing it into my Android Project, too, fixed the issue that you described.

Comments

-1

In VS 2015 Professional:

  1. right click on the image under your project
  2. select properties
  3. choose Embedded Resource for Build Action
  4. in your code behind file type under InitializeComponent() method the following code image.Source = ImageSource.FromResource("YourProjectName.YourFolderName.YourImage");
  5. save everything
  6. Build solution
  7. close VS
  8. open project and run again

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.