2014-03-25 58 views
1

我正在嘗試將我在Microsoft Azure中承載的Web服務添加到腳本#項目中,並且我遇到了一些問題。將Web服務引用添加到腳本#項目

目前我正在儘可能地做到這一點,所以我正在使用腳本#> jQuery腳本庫項目,只有自動生成的代碼。如果我用鼠標右鍵單擊該解決方案>添加服務引用>高級...>添加Web引用,然後編譯我得到的不兼容錯誤的一個重要的量:

Error 1 The type or namespace name 'GeneratedCodeAttributeAttribute' does not exist in the namespace 'System.CodeDom.Compiler' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Properties\Settings.Designer.cs 15 38 ScriptSharpEmAirTest 
Error 2 The type 'System.CodeDom.Compiler.GeneratedCodeAttribute' exists in both 'c:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\packages\ScriptSharp.0.7.5.1\tools\mscorlib.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll' C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Properties\Settings.Designer.cs 15 38 ScriptSharpEmAirTest 
Error 3 The type or namespace name 'GeneratedCodeAttributeAttribute' does not exist in the namespace 'System.CodeDom.Compiler' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 26 30 ScriptSharpEmAirTest 
Error 4 The type 'System.CodeDom.Compiler.GeneratedCodeAttribute' exists in both 'c:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\packages\ScriptSharp.0.7.5.1\tools\mscorlib.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll' C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 26 30 ScriptSharpEmAirTest 
Error 5 The type or namespace name 'DebuggerStepThroughAttributeAttribute' does not exist in the namespace 'System.Diagnostics' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 27 25 ScriptSharpEmAirTest 
Error 6 The type or namespace name 'DebuggerStepThroughAttribute' does not exist in the namespace 'System.Diagnostics' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 27 25 ScriptSharpEmAirTest 
Error 7 The type or namespace name 'DebuggerNonUserCodeAttributeAttribute' does not exist in the namespace 'System.Diagnostics' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Properties\Settings.Designer.cs 27 37 ScriptSharpEmAirTest 
Error 8 The type or namespace name 'DebuggerNonUserCodeAttribute' does not exist in the namespace 'System.Diagnostics' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Properties\Settings.Designer.cs 27 37 ScriptSharpEmAirTest 
Error 9 The type or namespace name 'SendOrPostCallback' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 33 34 ScriptSharpEmAirTest 
Error 10 The type or namespace name 'SendOrPostCallback' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 35 34 ScriptSharpEmAirTest 
Error 11 The type or namespace name 'SendOrPostCallback' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 37 34 ScriptSharpEmAirTest 
Error 12 The type or namespace name 'SendOrPostCallback' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?) C:\Users\Axel\Documents\Visual Studio 2012\Projects\ScriptSharpEmAirTest\ScriptSharpEmAirTest\Web References\net.azurewebsites.emair\Reference.cs 39 34 ScriptSharpEmAirTest 

(實際上有這樣的錯誤158)

很明顯,在添加web引用之前進行編譯可以順利進行,並且具有相同web引用的控制檯項目看不到任何問題。

您可以將web參考添加到scripsharp項目嗎?有沒有特定的程序要遵循?

+1

這是不可能的,腳本#只支持.net框架的最小子集。 – LunicLynx

+1

有沒有像這樣的官方聲明,這是不可能的?也許NikhilK發表評論? – Axel

回答

0

https://github.com/nikhilk/scriptsharp/issues/414#issuecomment-39080016同樣的問題?

我評論有,但會複製到這裏,對於那些誰在未來就同一問題/問題絆倒:

...一些情境的東西要牢記。

腳本#與運行.net代碼無關。它關於使用c#語言編寫 作者腳本應用程序,並使用腳本環境 (在瀏覽器中,在node.js等中)的功能。對於許多這些「我如何在腳本#中執行x操作」問題的答案與「如何在 insert_your_script_environment中執行x操作」相同。因此,如上所述,在JavaScript客戶端中,您可能(或者我應該說理想地說 ,因爲有時候基於WCF的 實現不是這種情況)使用帶有簡單REST的服務說的是JSON的API 。這同樣適用於腳本#。

相關問題