0
有一點問題試圖編譯XNA的內容項目,錯誤編譯內容項目
基本上,如果沒有什麼內容的項目,我可以編譯和運行正常,但是當我添加任何類型的對象(圖像,SpriteFont類,紋理,模型),它不會編譯並總是給這個錯誤:
Error 1 Building content threw InvalidCastException: Unable to cast object of type 'Microsoft.Xna.Framework.Content.Pipeline.Interop.RefDevice' to type 'System.IDisposable'.
at Microsoft.Xna.Framework.Content.Pipeline.CommonHelperFunctions.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates, Dictionary`2& dependencyTimestamps, KeyValuePair`2[]& warnings) D:\Directory\Content\System\UI\Backgrounds\bg.png SolarFusion
任何幫助將是巨大的。
您的計算機是否有支持XNA的顯卡? –
就像我說的,只要沒有內容,我的XNA應用程序運行良好,問題是編譯階段沒有運行。 –
這是一個非常奇怪的錯誤。我建議重新安裝XNA和可能的DirectX作爲一個整體。 –