2013-05-14 38 views
2

我遇到問題...沒有人可以提供幫助,因此我想知道這裏有人可以嗎?在.NET 4.5中創建配置節處理程序錯誤時發生錯誤

我有一個Web服務項目(最初在.NET 2.0中,但升級到.NET 4.5),今天上午工作完美。我也有一個連接到Web服務的Winforms項目。

在構建Winforms應用程序,構建成功,運行它時,我得到的錯誤:

An error occurred creating the configuration section handler for applicationSettings/Windows.Main.Properties.Settings: Could not load file or assembly 'Application, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

我已經通過SO和其他網站看了,但找不到任何具體顯示的這個事業錯誤。我試過降級.NET框架,並再次對它們進行升級 - 一切都在4.5上運行 - 但這種失敗的:

[global::System.Configuration.ApplicationScopedSettingAttribute()] 
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] 
[global::System.Configuration.DefaultSettingValueAttribute("http://localhost:53442/ConfigurationService.asmx")] 
public string Windows_Main_BnConfigurationService_ConfigurationService { 
     get { 
      return ((string)(this["Windows_Main_BnConfigurationService_ConfigurationService"])); 
     } 

我已經通過代碼負荷檢查,但似乎無法找到的原因問題。

對於知道的人來說,這可能是一個簡單的修復,但我只是不知道這個錯誤!幫幫我?!

+0

你有沒有更新在贏得形式的Web服務的參考? – Arshad 2013-05-14 13:18:14

+0

對不起 - 我錯過了這個。是的,我做到了。我甚至刪除它並重新添加它。另外,我在WS解決方案中創建了一個新的Web服務,通​​過WebMethod和引用複製 - 仍然沒有歡樂:( – 2013-05-14 13:22:54

+0

您可以刪除舊的引用並添加新的引用 – Arshad 2013-05-14 13:24:00

回答

0

固定! WebService解決方案最初是在.NET 2.0上設置的。這在Windows.Main應用程序中引用了OK。 WebService框架隨後更新爲4.5,但Windows應用程序中的引用並未更新 - 即使在刪除並重新添加它們之後。我已經將Web服務升級到WCF,它看起來不錯!感謝您的輸入人!它引導我朝着正確的方向前進! :)

相關問題