2015-05-26 21 views
0

我正在開發一個asp.net網站,從MySQL數據庫中提取數據,並使用內置的Visual Studio報表生成器生成報告。 應用程序編譯和本地機器上完美調試,但是當上傳到Windows服務器上運行IIS我得到以下錯誤:無法生成代碼,異常的類型'System.Data.Design.InternalException

Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Failed to generate code. Exception of type 'System.Data.Design.InternalException' was thrown.

Source Error:

(Line 1 is highlighted red on the error page)

Line 1: <?xml version="1.0" encoding="utf-8"?>

Line 2: <xs:schema id="SensorReadingsDataSet" targetNamespace="http://imr.bi3.co/App_Code/SensorReadingsDataSet.xsd" xmlns:mstns="http://imr.bi3.co/App_Code/SensorReadingsDataSet.xsd" xmlns="http://imr.bi3.co/App_Code/SensorReadingsDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">

Line 3: <xs:annotation>

Source File: /Dev/App_Code/SensorReadingsDataSet.xsd Line: 1


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET >Version:4.0.30319.34212

我試着運行在我的數據集的自定義工具,建議在這裏(Custom tool error Failed to generate code) ,但該選項在Visual Studio中顯示爲灰色。我沒有對.xsd文件或數據庫結構進行任何更改,因爲它是由VS創建的。

我也嘗試完全刪除數據集&報告並重新從頭開始重建,這仍然會導致同樣的錯誤。

任何幫助,非常感謝。 謝謝,

回答

0

你只是提醒我部署應用程序的正確方法!

我是個懶惰的傢伙,我在開發機器和生產機器上安裝Visual Studio。

我在Visual Studio的'Team Project'中爲開發機器和生產機器創建了另一個用戶名。

因此,每次部署應用程序時,我都會在生產計算機上使用獲取最新代碼並重新編譯。當然在生產機器的IIS中,創建一個Web站點指向項目的根目錄。

這樣可以避免一些問題,只要兩臺機器用同一版本的Visual Studio和其他相關的安裝。

相關問題