XNA Creators Club Online
Page 1 of 1 (11 items)
Sort Posts: Previous Next

Cannot compile project with XACT due to "missing files" and compilation issues.

Last post 04-02-2008 6:59 PM by Vulcanis. 10 replies.
  • 02-05-2008 9:05 PM

    Cannot compile project with XACT due to "missing files" and compilation issues.

    I attempted to follow the XACT and the simple play a sound tutorial, but I cannot get the project to compile.

    It says the wave files are missing.  I placed them, through the Solution Explorer, to [Solution Name]\[Project Name]\Content\Audio.  However, in the error, it is looking for them in the wrong place, adding an extra "\Content\" to the path if I put the XAP file in the root of the Content folder.  If I put the XAP in the Content\Audio folder within my solution, it adds an extra "\Content\Audio\" to the path in the error message.  So, for example, if the XAP file is in the root of the Content folder, it is searching in: "Content\Content\Audio\myWaveFile.wav" instead of "Content\Audio\myWaveFile.wav."

    Every once in a while, with much fiddling, I can get it to "find" the files (I don't think it really is since I wasn't changing the file structure), but then it says it doesn't know how to compile wav files and to choose a processor or importer, which in the wav file properties in the Solution Explorer there is no wav file importer like there is for other file types like .X files.

    Quick help appreciated.  Cheers.

     

     

     

     

    <Rant>
    Don't read this part if you don't want to hear my complaints, it is unrelated to the above.

    I have been coding Managed DirectX and DirectX for years, and I have been quite delighted with Managed DirectX.  When I heard it was being discontinued for XNA, I was worried.  Turns out XNA has been great and even easier and faster!  Yay! 

    Until I hit this sound stuff.  From what I read in trying to fix my current problem, it appears you cannot play wav files by themselves.  Why in the world can't you play wave files straight up like you could with DirectSound?  The whole XACT thing seems like a giant pain in the butt and not worth my time.  I'll agree that DirectSound was confusing, but now I have to have a secondary program to Visual Studio just to precompile my sound effects?!  Why do I even have to precompile my sound effects?  What if I wanted the users to pick music or something?  Just seems like a lot of effort when many projects will not use all the benefits of XACT.  It also seems quite limiting to me.  However, this rant is relatively minor to my overall frustrations actually...

    Not related to the XNA framework, I would like to express my most sincerest disdain in these XNA forums.  Not the community or the lovely people helping people learn XNA, but the sign-up process.  I spent more than fifteen minutes signing up for these forums.  That's just obscene.  I had to sign up for a Windows Live account, then an XBox account, yet I have no XBox.  I had to give Microsoft my e-mail three times for some ungodly reason.  I had to enter my user name three times.  I had to confirm my e-mail twice.  Wasn't the first time enough?  Heck, why do I have to two accounts to post on these forums?  Why is it warning me about XBox points in case to I want to change my username?  I don't even have an XBox; how the heck am I supposed to get these points anyway?  What is all this this garbage!?  It was a ten step process to finally post my simple (I know it is an easy question!) question! Add that to my frustrations about XACT made want to scream in my office today which probably wouldn't have been good.

    XNA != XBox.  I don't own an XBox.  Don't make me fill out *#$^ about one.  I just wanted to post to the forums.  I can't be the only person who is transitioning from Managed DirectX to XNA who doesn't have an XBox.  I can't be the only non-XBox person out there that doesn't want to spend fifteen plus minutes filling out the same darned information over and over just to get a little help.  My question is a simple "oh, you just need tweak this one property" type of question and it has taken me as long as it would have taken me to import my old DirectSound code.

    Lastly, it seems many people have been confused where to put files in the Solution Explorer.  In the tutorial for getting sounds into XNA, it says to add the XAP file to the solution, not the content folder.  Luckily, I have been using Visual Studio since the dawn of time, so I figured it should probably go in the Content folder which appears to be right--if I could get it to compile.  Anyway, that tutorial should be made more clear for everyone.  Or just add screenshots of the solution explorer to make it clear.
    </Rant>

  • 02-06-2008 12:42 AM In reply to

    Re: Cannot compile project with XACT due to "missing files" and compilation issues.

    Is this an upgraded project or a new project? By upgraded, I mean was it a project that you created with XNA Game Studio Express 1.0, and then upgraded to XNA Game Studio 2.0? Or did it start off as a 2.0 project?

    The upgrade wizard sometimes causes the resulting project to behave a bit differently than standard projects, and this could be a bug resulting from that. If this is the case, I can help you fix your project.

    In case you got the project from someone else, can you confirm whether the content.contentproj file is in the Content subfolder, or in the same folder as your .csproj file?

     

    Stephen Styrchak | XNA Game Studio Developer
  • 02-06-2008 10:34 AM In reply to

    Re: Cannot compile project with XACT due to "missing files" and compilation issues.

    Nope, this is not upgraded or downloaded.  I am putting it into my own recent project that uses some DLLs with wrapper classes that provide similar functionality to my old DirectX engine but built with XNA.  Everything was built in the past few weeks, long after XNA 2.0 was released.

    The content.contentproj file is located within the Content folder, as I have always seen it placed.

    My problem appears to be a straight up pathing issue, hidden in some property somewhere.  I was hoping this was simple to solve!

    Cheers.

  • 02-06-2008 12:06 PM In reply to

    Re: Cannot compile project with XACT due to "missing files" and compilation issues.

    At run time, the ContentManager uses the value of its ContentRootDirectory property as a prefix to all paths given to its Load methods. If the error was at runtime, then trying to load @"Content\Audio\MySound" would probably give you an exception for the file not being found, and you'd see it looking in @"Content\Content\Audio\MySound". That could be fixed by either changing the ContentRootDirectory property, or not specifying that part of the path in the Load argument.

    If you are having trouble compiling, though, I don't know what that might be. Could you copy/paste the error text from the Error List so we can see it? If you look in the Output Window after a build, is there any more information about the error?

     

    Stephen Styrchak | XNA Game Studio Developer
  • 02-06-2008 2:40 PM In reply to

    Re: Cannot compile project with XACT due to "missing files" and compilation issues.

    I haven't even gotten to coding anything yet.  I had only gotten as far as seeing if I could compile the project with the XAP project included.

    As I said in the original post, it will sometimes find the file if I add and remove the XAP and wav files.  I had removed them temporarily because I needed to work on other aspects of my project while awaiting a response here.  This time, it seems to have found the files, but says this:

    "Error 1 Cannot autodetect which importer to use for "Audio\ak47 chamber round.wav". There are no importers which handle this file type. You must specify the importer in your project, or the appropriate importer's ContentImporterAttribute must be changed to explictly handle this file type. C:\Documents and Settings\[username]\My Documents\Visual Studio 2005\Projects\[SolutionName]\[Project Name]\Content\Audio\ak47 chamber round.wav Content ([Project Name]\Content)"

    I cannot get the missing file message to display at this moment, however, it was the typical "Wave file '[Name]' cannot be found at '[Path]'" error.  You can find other people having the same problem if you Google around.

    Cheers.


     

  • 02-06-2008 3:01 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    Answer

    Ah, I think I understand. When you add files to the content project, they default to being compiled by the Content Pipeline. In the case of .wav files, they get processed implicitly when you build the .xap, and shouldn't be configured to be explicitly built themselves.

    Try adding the .wav files to your project, then editing their properties (F4 to open the Properties Window). In the Properties Window, the .wav file's Build Action property will be automatically set to Compile. Change that to None.

     

    Stephen Styrchak | XNA Game Studio Developer
  • 02-06-2008 4:11 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    I had tried that before, but it was too worried about mispathing files for it to work!

    Now that it is back to the "cannot compile" problem and not the mispathing issue, yes, what you suggested worked perfectly!  Yay!

    However, if the mispath issue returns, I'll be lost once again.  Do you think it would be related to having XACT open?  I had it shut down this time around.  The mispath issue will probably happen when I have to add more files to the project...

    Thanks for the help.

  • 02-06-2008 4:29 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    I'm not sure what the problem might be. I'm pretty sure that XACT stores the paths to wav files as relative paths in the xap file. Those should be relative to the xap file itself, so if you move it, then it might cause a problem.

    As a complete guess, maybe the first time you created the XACT project, it was created in the project root directory. Then when you added the xap file to the project in VS, it copied the file to a new location. This is the default behavior when adding existing files that are outside the project directory (the Content directory for content projects). If that's the case, you might not see the behavior again, until you create a new XACT project. Have you got an older .xap file in your project's root directory?

    If the problem does happen again, you might consider opening the .xap in the text editor and looking for malformed paths, like "Content\Content\". That will at least narrow down whether it is an XACT problem or a Content Pipeline problem.

     

    Stephen Styrchak | XNA Game Studio Developer
  • 02-06-2008 8:18 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    I did think about looking through the XAP file through notepad, but I wanted to hear the "official reasoning" behind the problem before settling on a hackey method.  Adding new assets to a game is already taking more time than I expected, particularly with sound effects; I don't want to make it any longer than it has to since one has to add new assets all the time.

  • 02-07-2008 5:03 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    are you using XACT or trying to directly import the .wav's?  if it is the latter make sure the content pipline is using the correct importer/processor (your own custom ones as .wav is not supported in this version of XNA GSE).  if it is the former are they on a network or mapped drive?  i have the same issue becuse windows was not updating the drive availability (in my computer it shows an error next to the drive name)  opening the drive in explorer and recompiling fixed the issue.

     

    in both cases check the contentroot property, i think it gets set in the main game class in initialise (not sure though, am not on my machine, it could be somewhere else)

    hope this helps and if you do find the cause please let us know - i'm probably going to have the same issue soon.

    See what I'm up to here
  • 04-02-2008 6:59 PM In reply to

    Re: Cannot compile project with XACT due to &quot;missing files&quot; and compilation issues.

    I was having this issue as well...once I got XACT to work without randomly crashing with no warnings or messages.

    My first attempt to run my program after importing my .xap file was that it couldn't find the .wav failes, even though they were in the correct spot.

    I solved it by deleting my .xap file, and opening a new project, this time saving it from the beginning in the content/audio folder of my project.  This time, when I inserted my .wav files and ran my program, it didn't have an issue with finding the .wav files.

    It appears the filepath is set when you save your XACT project, and doesn't get updated when you import it into your XNA project content folder.

Page 1 of 1 (11 items) Previous Next