2011-02-17 70 views
4
Unable to generate a temporary class (result=1). error CS2001: Source 
file 'C:\Windows\TEMP\h3ugizgc.0.cs' could not be found error CS2008: 
No inputs specified 

error line 
MemoryStream stream = new MemoryStream(System.Text.Encoding.Default.GetBytes(xmlSettings)); 
Line 52:     XmlSerializer serializer = new XmlSerializer(typeof(Items)); 
Line 53:     items = (Items)serializer.Deserialize(stream); 

我收到此錯誤消息時,我嘗試用朗姆酒IIS我的應用程序在Windows 7無法生成臨時類

回答

8

是應用程序配置爲在特定用戶帳戶下運行?

如果是這樣,請檢查與該應用程序關聯的用戶帳戶具有%windir%\ Temp文件夾中的列出文件夾內容和讀取權限。

+0

我遇到了這個問題,雖然我的IIS是「開箱即用」,但仍然需要在事情發生之前添加IIS_IUSRS。 – AlG 2012-02-24 14:00:53

1

我知道這是一個老問題,但它仍然有效(問題仍然存在),以下是其他人遇到此問題時的更多信息:http://blog.coderunnr.com/2012/06/net-xmlserializer-unable-to-generate-a-temporary-class/

該文章包含幾個解決方案(向模式添加屬性)和示例。這個問題實際上是在.NET中的XmlSerializer的錯誤:http://connect.microsoft.com/VisualStudio/feedback/details/349967/xsd-exe-generates-code-with-the-wrong-type-in-an-xmlarrayitemattribute

0

也許如果你使用戶的本地管理員

  • 打開計算機管理OG右鍵CLIK「計算機」,然後選擇管理。
  • 展開:組
  • 雙擊:管理員組
  • 將用戶添加到組

希望這個作品。