locked
I keep getting XamlFilePathAttribute class not found error when modifying Xaml files RRS feed

  • Question

  • User65613 posted

    This attribute was introduced in November. Somehow it get's injected in my generated cs files for my xaml views but the compiler has no clue where to find the attribute. I suppose I have a versioning problem. Is it possible to get the versions where this was introduced in tools and in the libraries please?

    Thursday, January 12, 2017 4:22 PM

Answers

  • User65613 posted

    What I do is that I simply remove the line from the generated .cs file for the view

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, March 11, 2017 1:14 AM

All replies

  • User65613 posted

    Could it be due to this line in my AssemblyInfo.cs? I didn't have that before...

    [assembly: XamlCompilation(XamlCompilationOptions.Compile)]

    Monday, January 16, 2017 4:22 PM
  • User289595 posted

    Getting the same issue. Did you resolve it?

    Tuesday, January 24, 2017 8:33 AM
  • User203473 posted

    The same for me. I'm working with Xamarin.Forms. I've just updated all to the latest versions (Android SDK, all founded by Xamarin Studio updates , all packages in solution) and now I can't build the project.

    Wednesday, January 25, 2017 9:30 PM
  • User203473 posted

    Ok, here is what I did to fix it. - Cleanup solution - Close Xamarin Studio - Remove all .bin and .obj folders in all projects. - Open Xamarin Studio and rebuild the solution.

    I think the key is to remove .bin and .obj folders and rebuild the solution, because the generated .g.cs files are located somewhere in that folders, and they keep referencing on something inappropriate. After removal they will be regenerated without the error.

    Wednesday, January 25, 2017 10:02 PM
  • User294029 posted

    @Cuckooshka thank you it works

    Friday, January 27, 2017 2:44 PM
  • User20038 posted

    Cleaning of bin and obj did not work.

    Error CS0234: The type or namespace name XamlFilePathAttribute' does not exist in the namespaceXamarin.Forms.Xaml'. Are you missing an assembly reference?

    Wednesday, February 1, 2017 8:31 PM
  • User69033 posted

    @Cuckooshka said: Ok, here is what I did to fix it. - Cleanup solution - Close Xamarin Studio - Remove all .bin and .obj folders in all projects. - Open Xamarin Studio and rebuild the solution.

    I think the key is to remove .bin and .obj folders and rebuild the solution, because the generated .g.cs files are located somewhere in that folders, and they keep referencing on something inappropriate. After removal they will be regenerated without the error.

    For Xamarin studio we can use this fix. But im working on Jenkins automated build system. Every time i'm getting this error during release build. Any other solution for this?

    Thursday, February 16, 2017 7:55 AM
  • User110999 posted

    Update Xamarin.Forms to version 2.3.4.192-pre2 from nuget. It solves the issue

    Sunday, February 19, 2017 5:09 PM
  • User306386 posted

    With VStudio you need click in Solution Clean after Click in Compile Solution.

    con visual studio es necesario limpiar el proyecto y despues compilar desde la misma solucion, no necesite regresar la version.

    saludos

    Wednesday, March 8, 2017 7:33 PM
  • User65613 posted

    What I do is that I simply remove the line from the generated .cs file for the view

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, March 11, 2017 1:14 AM
  • User316198 posted

    Hi SylvainGravel,

    Removing the line worked for me.

    Thanks, Akash

    Tuesday, April 11, 2017 5:01 AM
  • User164937 posted

    Remove all .bin and .obj folders in Portable project and Try.

    It works for me.

    Thanks

    Monday, May 8, 2017 5:07 PM
  • User83193 posted

    Removing bin's and obj's, clean and build does not work for me. Removing the line from the xaml.g.cs works but I have 148 of these errors and I clean and rebuild they get generated again. Impractical. Has anyone got a permanent solution?

    Tuesday, May 23, 2017 7:16 AM
  • User65613 posted

    Update your Forms version, it should be fixed by now

    Tuesday, May 23, 2017 4:17 PM
  • User328477 posted

    The type or namespace name XamlFilePathAttribute' does not exist in the namespaceXamarin.Forms.Xaml'. Are you missing an assembly reference?

    Thursday, August 17, 2017 6:58 AM
  • User13348 posted

    Update all projects version of Xamarin Forms with the same version resolve this issue.

    Friday, August 18, 2017 10:39 AM
  • User353223 posted

    @Cuckooshka said: Ok, here is what I did to fix it. - Cleanup solution - Close Xamarin Studio - Remove all .bin and .obj folders in all projects. - Open Xamarin Studio and rebuild the solution.

    I think the key is to remove .bin and .obj folders and rebuild the solution, because the generated .g.cs files are located somewhere in that folders, and they keep referencing on something inappropriate. After removal they will be regenerated without the error.

    Thanks, It worked.

    Tuesday, November 7, 2017 4:54 PM
  • User357642 posted

    Clean .obj and .bin folder. Restart VS in Admin mode and Build.

    Wednesday, November 8, 2017 8:10 PM
  • User364538 posted

    For me, this worked (VS 2017)

    • remove all obj and .bin directories
    • start VS as admin
    • load solution and "build" - "clean" it
    • rebuild all

    Not sure whether all those steps were requred. Fact is, now it works. Note: the probem does usually occur if I load sample projects from Github and try to compile them for the first time. Maybe a version clash if my Xamarin version differs from the original author's?

    Monday, February 5, 2018 7:31 AM
  • User376776 posted

    For me, it was my stupidity that caused this problem. I created an initial page via xaml and wished to implement that template across additional pages. In my laziness, i succumbed to a copy - paste error. The line that did it for me was the x:Class...

    Tuesday, September 11, 2018 10:17 AM