Xamarin.Forms Previewer - An android application project must reference a project containing this xaml file in order to render in the previewer

后端 未结 6 1149
孤城傲影
孤城傲影 2021-02-20 01:53

I\'m getting the following error when trying to preview XAML documents via the Xamarin.Forms Previewer while in Visual Studio.

An Android Application proj

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-20 02:13

    i think my solution is help this problem.

    it has two problem, one is the solution path, the other one is dll reference.

    I'll explain it with the example program Todo(example forum).

    first, you have to clean your solution path like below png

    png

    secondly, you have to clean your all project (Todo, Todo.android, Todo.ios...)

    then, you'll be able to see warning at Todo.dll(in Todo.android referense)

    then, you have to delete Todo.dll

    and build your Todo project then will create new dll

    finally, Add it('new dll') to Todo.anroid project reference and include a Todo project in your Todo.android project(Todo.android reference add-> project -> check Todo).

    check Todo

    and restart visual studio

    result

提交回复
热议问题