c# - xml file not being compiled by XNA -
i'm making game using xna 4.0/visual studio 2013. want load content using xml files, , i'm testing simple xml called terminator.xml. (it's serialized in project class called "movie", 1 property called "name").
i've added xml file content project , set "build action" compile , "copy output directory" copy always.
however, keep getting a:
file not found
...error. looks xml file never being compiled , transferred debug folder, though should be.
here relevant code. it's interesting note spritefont loads, not xml file.
font = content.load<spritefont>(@"font"); movie = xnaserializer.deserialize<movie>(@"terminator");
here's error text:
could not find file 'c:\users\h119650\documents\visual studio 2013\projects\elysium\elysium\elysium\bin\x86\debug\terminator'
also, supposed try put compiled file elysium instead elysiumcontent? seems bit suspect, looking @ file path above.
i see 2 problems here.
- you error message states looking terminator file opposed terminator.xml it's idea use
xnaserializer.deserialize<movie>(@"terminator.xml")
. - you should not set build action compile if file not compiled. use content instead.
Comments
Post a Comment