Forum Visual Studio

Why "add existing images" is grayed out?

YigalBYigalB Member ✭✭

I am following Xamarin first video from [https://dotnet.microsoft.com/learn/xamarin/hello-world-tutorial/intro] with VS2019. It was working just great until I reached to time 7:36 on the 5th video, trying to add an image. The video is guiding to right click drawable and select existing image, but this option it is grayed out. Should I do anything to enable it? or create my own folder with images?
I was assuming there is a folder with few pre-loaded images, but I might have been wrong.

Best Answer

  • LandLuLandLu Xamurai
    Accepted Answer

    Yes, you can't change the settings when your project is running.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Do you mean you can't select the existing item here?

    There are no other extra instructions to enable this behavior. It is enabled by default.
    You could also try another easier approach to add images to the project.
    Try to copy your image directly(I mean ctrl + c) and then ctrl + v in the destination folder. Finally, it has been involved in your project.

  • YigalBYigalB Member ✭✭

    @LandLu said:
    Do you mean you can't select the existing item here?

    There are no other extra instructions to enable this behavior. It is enabled by default.
    You could also try another easier approach to add images to the project.
    Try to copy your image directly(I mean ctrl + c) and then ctrl + v in the destination folder. Finally, it has been involved in your project.

    Yes - these options are grayed out.
    Since I am a newbie with Xamarin, I did nothing special, used it out of the box.

    Can you tell me which directory is used by default when using the "existing item"? Perhaps for some reason it doesn't exist?
    Now that I type, I recall I changes the directory for the projects. I prefer projects to be located under "my documents", to allow backup, and easy copying to another computer, just in case.

  • LandLuLandLu Member, Xamarin Team Xamurai

    Yes - these options are grayed out.
    Since I am a newbie with Xamarin, I did nothing special, used it out of the box.

    Try to create a new blank Xamarin Android project and check it out again.

    Can you tell me which directory is used by default when using the "existing item"?

    Visual Studio will copy the selected items to your project instead of using a reference. So there's no such a folder that could be reusable for locating your resources. Each files the project needs should be located in its own space.

  • YigalBYigalB Member ✭✭

    @LandLu said:

    Try to create a new blank Xamarin Android project and check it out again.

    It is working now, thanks. Perhaps it was grayed because the emulator was running?

  • LandLuLandLu Member, Xamarin Team Xamurai
    Accepted Answer

    Yes, you can't change the settings when your project is running.

Sign In or Register to comment.