Датам в коде выход с потока преждевременно:
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
}
protected override void UnloadContent()
{
Application.ExitThread();
}
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
}
Я его убрал и все пошло, но есть еще:
- Когда я интегрировал
XNA проект с загрузкой меша в ASP, при запуске произошла новая ошибка:
Server Error in '/' Application.
Could not find a part of the path 'C:\windows\assembly\GAC_32\Microsoft.Xna.Framework\3.1.0.0__6d5c3888ef60e27d\Content\Head.xnb'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\windows\assembly\GAC_32\Microsoft.Xna.Framework\3.1.0.0__6d5c3888ef60e27d\Content\Head.xnb'.
Source Error:
Line 54: spriteBatch = new SpriteBatch(GraphicsDevice);
Line 55:
Line 56: face = Content.Load<Model>("Head");
Line 57: }
Line 58:
Source File: C:\Documents and Settings\Володя\Мои документы\Visual Studio 2008\Projects\Test_XNA_App\Test_XNA_App\Game1.cs Line: 56
Stack Trace:
[DirectoryNotFoundException: Could not find a part of the path 'C:\windows\assembly\GAC_32\Microsoft.Xna.Framework\3.1.0.0__6d5c3888ef60e27d\Content\Head.xnb'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName) +94
[ContentLoadException: Error loading "Head". File not found.]
Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName) +224
Microsoft.Xna.Framework.Content.ContentManager.ReadAsset(String assetName, Action`1 recordDisposableObject) +87
Microsoft.Xna.Framework.Content.ContentManager.Load(String assetName) +202
Test_XNA_App.Game1.LoadContent() in C:\Documents and Settings\Володя\Мои документы\Visual Studio 2008\Projects\Test_XNA_App\Test_XNA_App\Game1.cs:56
Microsoft.Xna.Framework.Game.DeviceCreated(Object sender, EventArgs e) +24
Microsoft.Xna.Framework.GraphicsDeviceManager.OnDeviceCreated(Object sender, EventArgs args) +23
Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice(GraphicsDeviceInformation newInfo) +481
Microsoft.Xna.Framework.GraphicsDeviceManager.ChangeDevice(Boolean forceCreate) +348
Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice() +10
Microsoft.Xna.Framework.Game.Run() +92
Test_XNA_App.popa.updateXNAWindow(Game1 windows) in C:\Documents and Settings\Володя\Мои документы\Visual Studio 2008\Projects\Test_XNA_App\Test_XNA_App\popa.aspx.cs:33
Test_XNA_App.popa.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Володя\Мои документы\Visual Studio 2008\Projects\Test_XNA_App\Test_XNA_App\popa.aspx.cs:39
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
Можна ли ето исправить? Просто у проекте ASP нету ContentProcessor... и я не знаю что с етим можна сделать...