2014-03-25 59 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 。这同样适用于脚本#。

相关问题