Most voted "namespace" questions
A namespace is a grouping that provides context for the items it contains (names, concepts, etc.), allowing the coexistence of items with an equal name in separate namespaces. Use this tag for questions about namespace problems, but not just because your code uses namespaces.
Learn more…110 questions
Sort by count of
-
2
votes1
answer171
viewsHow to organize namespaces?
I heard that namespaces should be organized by layer, in case using some Pattern design which makes it possible, as Projeto.Controller, Projeto.UI, Projeto.Model, however, if we look at the…
-
2
votes1
answer1458
viewsProduct is a namespace but is used as a type
I have this error message: Product is a namespace but is used as a type It was working and when I arrived to compile, I’m picking up this error. How do I fix this?…
-
2
votes1
answer226
viewsproblem with namespace and PDO
Well I got a class Sql extending PDO, but when I define a namespace the following error message appears when creating an object from the Sql class: Fatal error: Class 'PDO-related classes' not found…
-
2
votes2
answers470
viewsHow to use namespaces without classes with autoload from Composer?
I’m trying to use the classless namespaces with the Poser autoload, but I believe it is failing, for example: /Foo/Bar.php namespace Foo\Bar { function baz() { echo 'Funcionou'; } } /index php.…
-
2
votes1
answer59
viewsWhat happens when using namespace within a namespace?
What happens when I use the directive using namespace x within a namespace? For example: namespace x { int k = 1; } namespace y { using namespace x; } Now when I use the namespace y can access…
-
1
votes2
answers830
viewsproblem with namespace when running project
I cannot make this code run, I am starting with namespace and would like to give me a tip to continue my studies. First class <?php namespace view\classes; class View { public function…
-
1
votes0
answers33
viewsWhat happens when I declare to be using (using) a namespace in a class?
When I declare the use of a namespace (example: using System;) in a Cs (C#) file, what happens? Am I just putting the classes belonging to the namespace in the scope of the class? Is there nothing…
-
1
votes0
answers94
viewsValidate namespace definition
PHP variables, if necessary, can be validated with the following Regular Expression: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* But what about the namespaces? I have a certain string, coming from a…
-
1
votes2
answers100
viewsExtension Methods in . NET does not work
I’m trying to create a Extension Methods for the class string. He’s not showing up. My class with the extension method: namespace MEUPROJETO.Extension { public static class StringExtension { public…
-
1
votes3
answers5839
viewsNamespace declaration statement has to be the very first statement or after any declare call in the script
I wonder what caused this problem that I solved "kind of without knowing how". I created the file mysql.php using Pspad editor to debug some queryes and mysteriously started to look like the bug:…
-
1
votes1
answer116
viewsFacebook namespace not working in JSF?
I’m using personal jsf, I’m trying to make facebook recognize my metatags: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"…
-
1
votes0
answers1781
viewsFatal Error Class not found - Namespace PHP
Hello I am using the following php codes <?php namespace lab312\database; class ScriptFactory { function __construct() { } //outras funcionalidades } and <?php namespace…
-
1
votes1
answer55
viewsError in namespace when creating "Resource Dictionary ..." inside a folder
In an empty project (test - WPF Application) I test two scenarios. Scenario 1 Right click on the project Add Resource Dictionary ... I get the following: <ResourceDictionary…
-
1
votes1
answer458
viewsConfigure Namespace and autoload PSR-0
I am developing a project with the following structure: The goal is to make autoload load the classes. The archive autoload.php: function autoload($className) { $className = ltrim($className, '\\');…
-
1
votes0
answers46
viewsWhen to use namespace in C++?
Here’s the thing, since I knew how to use using namespace std; was a bad practice I stopped using namespace. Only now I started studying the Opencv library and see in its documentation to use using…
-
1
votes1
answer89
viewsWhy some methods have ' :: '
Why some methods like Perl or Ruby: Net::FTP, has these two points; how is the construction of the methods of this class and why is created in this way (with this syntax) and not in the way used by…
-
1
votes1
answer643
viewsI can’t get functions from the System.Management class
I am unable to call some functions of the System.Management class; for my program. I’ve tried to put using System.Management; or System.Management.ManagementObject but it also doesn’t work. Code:…
-
1
votes1
answer88
viewsConnection error using namespace
I have a file that is responsible for the connection to BD and is in PDO. <?php namespace clientes\model; class conexaoPDO { public static $instance; private function __construct() { } public…
-
1
votes1
answer53
viewsDifferences between ways to reference a namespace
I’d like to understand why in some code examples, people import classes as follows: use \Firebase\JWT\JWT; and not just: use Firebase\JWT\JWT; Is there any difference in starting with a "\"? In my…
-
1
votes1
answer92
viewsReturn from Webservice does not respect the namespace of my own WSDL
Hello! I’m starting now in the world of Webservices. I made a WS in the eclipse Wizard using Axis 1 (if I’m not mistaken), in the style "Bottom up": No eclipse, positioned in the class that will be…
-
1
votes1
answer63
viewsCrud with Mongodb and C# error in type or namespace
Accompanying a Macoratti tutorial here, errors appear in three types. I don’t know what to add to solve. I Copy and Paste and gave error. Below the code: using MongoDB.Driver; using System; using…
-
1
votes1
answer213
viewsHow many classes can I put in one code?
How many "classes" I can add to my code? Let’s say I have the following existing command block: namespace _06_ByteBank { public class Cliente { private string _cpf; public string Nome { get; set; }…
-
1
votes1
answer45
viewsRails 5 belongs_to namespace
I have the following configuration module Account class Permission < ApplicationRecord end end module Account class GroupPermission < ApplicationRecord belongs_to :permission end end Table:…
-
1
votes0
answers57
viewsDjango error - 'agenda' is not a Registered namespace
py apps. from __future__ import unicode_literals from django.apps import AppConfig class AgendaConfig(AppConfig): name = 'agenda' py. from django.conf.urls import url from . import views from…
-
1
votes0
answers305
viewsError when instantiating object inside a namespace
I’m trying to use the mpdf library to print in PDF. However, the following error is occurring when instantiating the library: Fatal error: Trait 'Mpdf\Strict' not found in…
-
1
votes0
answers23
viewsScope problem in namespace and class, C++
I tried to create a complex class in a C++ namespace per exercise, but when I try to define some methods of my class, the compiler returns error. My code: Complex. h: #ifndef COMPLEX_N_H #define…
-
0
votes1
answer118
viewsPHP standardization Fig Namespaces
I have a PHP application with my mvc framework and follow the following template: Namespace Diretorio Desc Nautilus\ root/Nautilus/src/Nautilus_Web/ Aplicação principal Nautilus\Service…
-
0
votes2
answers320
viewsInstallation of Namespace
I have a test project that came without the Namespace System.Web.Helpers and others. I searched and didn’t find it. I should be, but it’s not. How to install the guy? Well, I can hunt on the…
-
0
votes1
answer362
viewsThe type or namespace name 'Ajaxcontroltoolkit' could not be found in the global namespace (are you Missing an Assembly Reference?
I have a problem when publishing or compiling the project, the following error appears: The type or namespace name 'Ajaxcontroltoolkit' could not be found in the global namespace (are you Missing an…
-
0
votes1
answer55
viewsI created my project, I’ve been editing every day, and recently out of nowhere he failed to recognize an existing namespace
I created my project in Visual Studio 2013, I’ve been editing every day, and recently out of nowhere it failed to recognize an existing namespace. The namespace appears in red with the message "The…
-
0
votes0
answers56
viewsPushsharp 4.0 - Namespace not recognized "Pushbroker"
I have the following problem, recently added to my server the lib PushSharp 4.0 to send notifications to Ios. However with the code I have, I’m having the following error: the type namespace name…
-
0
votes1
answer133
viewsAutoload controllers using namespace
I’m trying to give a restructured in a personal microframework, before not used much standard in the structure of the project, now I played all my back-end in the folder source, and I’m using…
-
0
votes0
answers216
viewsPDO class not found in namespace other than global
I’m creating a class that uses PDO, but in a different namespace than global: namespace Classes\Config; use \PDO; class Connection { public static function getConnection() { $dbhost = "algumhost";…
-
0
votes2
answers355
viewsError 1 The type or namespace name 'Datareader' could not be found (are you Missing a using Directive or an Assembly Reference?)
Good afternoon, I was performing a code to query my database when I appeared these error: Error 1 The type or namespace name 'Datareader' could not be found (are you Missing a using Directive or an…
-
0
votes0
answers161
viewsProblem namespace only works local
I’m having the following mistake: Fatal error: Class 'Kse\init\Bootstrap' not found in /home/dksec173/public_html/App/Route.php on line 8 In the development the namespace are working properly,…
-
0
votes0
answers35
viewsHow to use namespace when creating a class?
I’m working on a project that was created in php (5.3) without a framework. I need to use a database connection class I developed myself. The name of this class shall be db, but another class db…
-
0
votes1
answer291
viewsMy autoload by Poser is not working
I am learning to autoload using Composer, but am getting the following error while running the tests: Fatal error: Class 'App Model Database' not found in /var/www/Library/index.php on line 5 it’s…
-
0
votes1
answer226
viewsProblem with namespace and include
Good morning. I have a webservice made on slimPHP . I have a class called control, and he belongs to the namespace controllers, it works normally without problems , but there arose the need to…
-
0
votes1
answer149
viewsVB.NET, Visual Studio and Namespaces
How to make Visual Studio 2017 + VB.NET create new classes already with namespace, as it does in C#? I’ve tried creating and editing item templates using the parameter $itemfolder$, but it doesn’t…
-
0
votes0
answers641
viewsClass not found in namespace
I’m trying to use a class by using the namespace, but it always generates this error: Fatal error: Uncaught Error: Class 'Database\connect' not found in…
-
0
votes1
answer88
viewsAddress of the namespace
I have the file below that sends authenticated emails normally: <?php ini_set("display_errors",true); ini_set("display_startup_erros",1); error_reporting(E_ALL && E_NOTICE);…
-
0
votes1
answer286
viewsNamespace does not work in php 5.5
I’m making a simple system using php with mvc structure and I want to use the namespace, however, of the error stating that it does not find the Data class. Error: Fatal error: Class 'Config…
-
0
votes1
answer121
viewsnamespace php7 does not find url?
I’m trying to learn namespace but I’m having a hard time. Even doing exactly as it is in a video on youtube, but it doesn’t work. I have the project folder Projeto Projeto\Cadastros…
-
0
votes0
answers203
viewsHow do I use to call another namespace without using include?
I see programmers all the time using the "use" command below the "namespace" command without first using a include. An example is the Medoo library: namespace Medoo; use PDO; use Exception; use…
-
0
votes1
answer21
viewsCan I inherit namespaces?
I’m using composer with autoload in class namespaces, assuming I have the parent class Model: Model.php <?php namespace App\Model; use App\Utils; use \PDO; class Model {} And the daughter class…
-
0
votes2
answers670
viewsError Uncaught Error: Class 'Client Register' not found Using namespace
I am studying about namespaces, I wrote the code below, but is returning the following error: string(16) "Client Register" 'Client Register' not found in…
-
0
votes1
answer319
viewsNamespace in PHP Does not work
Hello, I’m trying to use the namespace and the use but is resulting in Not found Error: Fatal error: Uncaught Error: Class 'app\lib\Teste' not found in C:\xampp\htdocs\index.php:5 Stack trace: #0…
-
0
votes1
answer43
viewsI’m not getting to import a namespace that I created
Goodnight, I created a namespace called: Enums inside Models, when I try to import within a class the Enums, I’m not getting through... I’m with using Entity FrameWork with Asp.Net core MVC Folder…
-
0
votes1
answer103
viewsClass not found. Namespace and Composer psr-4
Guys I did everything you say in the other questions on the subject, but it didn’t solve my problem. So I opened a new question. My class is not being found. this is my structure: project _app |--…
-
-1
votes2
answers88
viewsIs it possible to view all the content of a C++ namespace?
When you make the directive: using namespace std; //primeira forma You get direct access to all elements of the Std namespace. But imagine that you want to use only the std::cout or std::endl so it…