F#未定义名称空间或模块“XXXX”

时间:2022-09-01 09:32:36

I'm trying to create a basic ASP.net f# application and when I'm trying to reference the Youtube .net API I'm getting a "The namespace or module 'Google' is not defined" in my code behind file.

我正在尝试创建一个基本的ASP.net f#应用程序,当我尝试引用Youtube .net API时,我在我的代码隐藏文件中得到了“命名空间或模块'Google'未定义”。

I've used the default ASP web forms template in Visual Studio, removed all of the contents, then loaded in the examples from Expert F#, Chapter 14. The default examples run fine, the problem only occurs when loading the Google API. The API works fine when I load it through an f# console application.

我在Visual Studio中使用了默认的ASP Web表单模板,删除了所有内容,然后从Expert F#,第14章的示例中加载。默认示例运行正常,只有在加载Google API时才会出现此问题。当我通过f#控制台应用程序加载它时,API工作正常。

The first few lines behind file looks like:

文件后面的前几行看起来像:

#light
namespace MyASPApp

open System
open System.Web
open System.Web.UI
open System.Web.UI.WebControls
open Google.YouTube

Can anyone think of a resolution to the problem, or anything I could check to understand why its not picking up the Google API?

任何人都可以想到解决问题的方法,或者我可以检查的任何事情,以了解为什么它没有拿起Google API?

2 个解决方案

#1


5  

The Google assembly may require that the application not use the Client Profile, which is the default in VS 2010. Try editing the project settings and changing the Target Framework property.

Google程序集可能要求应用程序不使用客户端配置文件,这是VS 2010中的默认设置。尝试编辑项目设置并更改Target Framework属性。

#2


2  

Did you check which version of .NET Framework that google assembly is built for? If it .NET 3.5 or .NET 4.0? If that is not set properly too this will occur.

您是否检查了为哪个版本的.NET Framework构建的.NET Framework?如果是.NET 3.5或.NET 4.0?如果没有正确设置,也会发生这种情况。

-Fahad

#1


5  

The Google assembly may require that the application not use the Client Profile, which is the default in VS 2010. Try editing the project settings and changing the Target Framework property.

Google程序集可能要求应用程序不使用客户端配置文件,这是VS 2010中的默认设置。尝试编辑项目设置并更改Target Framework属性。

#2


2  

Did you check which version of .NET Framework that google assembly is built for? If it .NET 3.5 or .NET 4.0? If that is not set properly too this will occur.

您是否检查了为哪个版本的.NET Framework构建的.NET Framework?如果是.NET 3.5或.NET 4.0?如果没有正确设置,也会发生这种情况。

-Fahad