C# 类型或命名空间名称不存在
我使用的代码如下:C# 类型或命名空间名称不存在,c#,asp.net,.net,namespaces,kentico,C#,Asp.net,.net,Namespaces,Kentico,我使用的代码如下: using CMS.DataEngine; using CMS.DocumentEngine; namespace Fort.CMS.CMSPages { public partial class CreatePage : System.Web.UI.Page { #region "Variables" private CMS.DocumentEngine.TreeNode mNode; private Tr
using CMS.DataEngine;
using CMS.DocumentEngine;
namespace Fort.CMS.CMSPages
{
public partial class CreatePage : System.Web.UI.Page
{
#region "Variables"
private CMS.DocumentEngine.TreeNode mNode;
private TreeProvider mTree;
在行中获取错误:private CMS.DocumentEngine.TreeNode mNode
错误:
中不存在类型或命名空间名称“DocumentEngine”
名称空间“Fort.CMS”
此处未识别DocumentEngine
但是如果我们删除名称空间,它就可以工作
namespace Fort.CMS.CMSPages
{}
我认为存在名称空间冲突。请按如下方式使用
using CMS.DataEngine;
using DE=CMS.DocumentEngine;
namespace Fort.CMS.CMSPages
{
public partial class CreatePage : System.Web.UI.Page
{
#region "Variables"
private DE.TreeNode mNode;
private TreeProvider mTree;
CMS.DocumentEngine
与另一个库是不同的名称空间吗?不,不是,但名称空间中存在冲突,因此我们需要放置名称空间的绝对路径实际上,是的CMS.DocumentEngine
是Kentico库中的名称空间。不要只发布没有解释的代码,这对任何人都没有帮助。