类型或命名空间'MyNamespace'不存在等(The type or namespace 'MyNamespace' does not exist etc)
我有通常的类型或名称空间名称不存在的错误,除了我已经引用程序集,using语句不显示为不正确的,我引用的类是公共的。 事实上,我在不同的解决方案中引用和使用相同的程序集来做同样的事情,并且它工作正常。
顺便说一下这是VS2010。
任何想法的人?
埃德
I have the usual type or namespace name does not exist error, except that I have referenced the assembly, the using statement does not show as incorrect and the classes I am referencing are public. In fact, I reference and using the same assembly in a different solution to do the same thing and it works fine.
This is VS2010 by the way.
Any ideas anyone?
Ed
原文:https://stackoverflow.com/questions/3861882
最满意答案
也许
AdminproductController
必须被称为AdminProductController
或者一个类文件被重命名,你必须改变类的用法。 另请阅读@Timothy的评论。Maybe
AdminproductController
must be calledAdminProductController
or a class file was renamed and you have to change the usage of the class. Also read @Timothy's comments.
相关问答
更多-
好的,我的问题是在我认为的重写机制中。 首先,在httpd.conf文件中我必须: 将“AllowOverride None”更改为相关目录中的“AllowOverride All”。 我的“mod_rewrite”被禁用,所以我不得不注释该行:“#LoadModule rewrite_module modules / mod_rewrite.so” Ok, My problem was in the rewrite mechanism as i thought. First, in httpd.conf ...
-
搞定了! ControllerBase.php $moduleName = $this->dispatcher->getControllerName(); $actionName = $this->dispatcher->getActionName(); // set view for current Controller and Action $this->view->setMainView('layout/index'); $this->view->pick($moduleName."/views/" ...
-
尝试使用名称空间并使用Phalcon加载器注册它们。 例如在ControllerBase中: namespace \Base\Frontend\Controllers; use \Phalcon\Mvc\Controller; class ControllerBase extends Controller; 在IndexController中: namespace \Base\Frontend\Controllers; class IndexController extends Controller ...
-
也许AdminproductController必须被称为AdminProductController或者一个类文件被重命名,你必须改变类的用法。 另请阅读@Timothy的评论。 Maybe AdminproductController must be called AdminProductController or a class file was renamed and you have to change the usage of the class. Also read @Timothy's co ...
-
在将数据发送到数据库之前,请使用模型验证程序。 通常,POST和模型中的数据(类型/结构/层次结构)会有所不同,例如,单个表单接收与两个模型相关的输入,这两个模型都将更新。 因此,在收到POST数据时,您要检查它是否有效,并且在保存两个独立模型后,您还需要检查它们是否有效。 Phalcon有一个验证组件 ,它是所有验证的基类。 它的工作方式与上面代码中的表单验证完全相同。 我并不是Phalcon中如何实现整个验证业务的忠实粉丝 - 它不会给你一个粒度级别的控制,并且验证和验证器之间存在很强的依赖关系。 然而 ...
-
看起来你改变了php控制台客户端的配置,但是apache中的php模块的配置不一样。 查看为apache模块加载的配置 looks like you changed the config for the php console client but that config is not the same for the php module in apache. Review what config is being loaded for apache module
-
嵌套控制器目录与Phalcon中的公共基本控制器(Nested controller directories with common Base Controller in Phalcon)[2022-02-13]
因为它似乎工作: 我有多个名称空间(多个路径)和许多控制器(有或没有名称空间),它们从一个ControllerBase (没有名称空间)继承。 所以这是可行的。 至于PHP能够加载你的类,你应该只能有一个ControllerBase 。 Because it seems to work: I have multiple namespaces (multiple paths) and many controllers (with or without namespace) that inherits from ... -
在bootstrap文件index.php替换 $url->setBaseUri('/tutorial/'); 同 $url->setBaseUri('/'); Replace in bootstrap file index.php $url->setBaseUri('/tutorial/'); with $url->setBaseUri('/');
-
在调用: domain/admin/actionofadmin (因为据我所知,域名是www.google.pl ), ActionofadminController根据您的路由期待ActionofadminController 。 你确定有这样的控制器吗? 不知道为什么使用dot它会击中索引控制器和索引操作。 How does Phalcon know where to find a view and link it to the correct controller? Example: A dashbo ...
-
如果你有兴趣,这是一个更合适的方法; 首先在您的DI中注册您的翻译作为服务: // $di initialization // ... $di->setShared('trans', function() use($di) { $session = $di->getShared('session'); $request = $di->getShared('request'); // Get language code if($session->has("lg")) { ...