Can't access other public classes in the same namespace











up vote
0
down vote

favorite












I have a few classes in a namespace called Mafia. Every cs file in the picture follows this structure:



    namespace Mafia {
public class Name {

}
}


And the file name matches the class name.



enter image description here



I can access all classes in EvenEmitter, NightAction, Player, Role, Roles, Settings, Win and ActionManager.



I can access Game, NightAction and PhaseManager from every other class as well, but I can't access any classes in Game, NightAction and PhaseManager.



(This is in Player.cs VVV)





You can see, I cannot access Game, NightAction and PhaseManager from the Mafia namespace, but I can access them like they aren't in a namespace. When I hover over them I get just class Game / NightAction / PhaseManager, not class Mafia. Game for example.



(This is in Game.cs VVV)



enter image description here



(Same thing happens in NightAction and PhaseManager).



So in short, I have a lot of classes in a single namespace. However, 3 of them are acting like they aren't in a namespace.



Some things I did before the problem occurred:




  • I renamed the folder, then noticed the problem and renamed it back.


For those who say that I forgot to public them:



enter image description here



enter image description here



enter image description here










share|improve this question




















  • 1




    Please share your other classes code which you can't access also. I guess you forgot to public these classes.
    – Nhan Phan
    Nov 9 at 7:48






  • 1




    @Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
    – John
    Nov 9 at 7:49










  • OP, please provide examples of these classes in your question, including their namespaces, etc.
    – John
    Nov 9 at 7:50






  • 1




    Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
    – John Wu
    Nov 9 at 7:50












  • @John added pictures.
    – Mxm
    Nov 9 at 7:55















up vote
0
down vote

favorite












I have a few classes in a namespace called Mafia. Every cs file in the picture follows this structure:



    namespace Mafia {
public class Name {

}
}


And the file name matches the class name.



enter image description here



I can access all classes in EvenEmitter, NightAction, Player, Role, Roles, Settings, Win and ActionManager.



I can access Game, NightAction and PhaseManager from every other class as well, but I can't access any classes in Game, NightAction and PhaseManager.



(This is in Player.cs VVV)





You can see, I cannot access Game, NightAction and PhaseManager from the Mafia namespace, but I can access them like they aren't in a namespace. When I hover over them I get just class Game / NightAction / PhaseManager, not class Mafia. Game for example.



(This is in Game.cs VVV)



enter image description here



(Same thing happens in NightAction and PhaseManager).



So in short, I have a lot of classes in a single namespace. However, 3 of them are acting like they aren't in a namespace.



Some things I did before the problem occurred:




  • I renamed the folder, then noticed the problem and renamed it back.


For those who say that I forgot to public them:



enter image description here



enter image description here



enter image description here










share|improve this question




















  • 1




    Please share your other classes code which you can't access also. I guess you forgot to public these classes.
    – Nhan Phan
    Nov 9 at 7:48






  • 1




    @Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
    – John
    Nov 9 at 7:49










  • OP, please provide examples of these classes in your question, including their namespaces, etc.
    – John
    Nov 9 at 7:50






  • 1




    Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
    – John Wu
    Nov 9 at 7:50












  • @John added pictures.
    – Mxm
    Nov 9 at 7:55













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a few classes in a namespace called Mafia. Every cs file in the picture follows this structure:



    namespace Mafia {
public class Name {

}
}


And the file name matches the class name.



enter image description here



I can access all classes in EvenEmitter, NightAction, Player, Role, Roles, Settings, Win and ActionManager.



I can access Game, NightAction and PhaseManager from every other class as well, but I can't access any classes in Game, NightAction and PhaseManager.



(This is in Player.cs VVV)





You can see, I cannot access Game, NightAction and PhaseManager from the Mafia namespace, but I can access them like they aren't in a namespace. When I hover over them I get just class Game / NightAction / PhaseManager, not class Mafia. Game for example.



(This is in Game.cs VVV)



enter image description here



(Same thing happens in NightAction and PhaseManager).



So in short, I have a lot of classes in a single namespace. However, 3 of them are acting like they aren't in a namespace.



Some things I did before the problem occurred:




  • I renamed the folder, then noticed the problem and renamed it back.


For those who say that I forgot to public them:



enter image description here



enter image description here



enter image description here










share|improve this question















I have a few classes in a namespace called Mafia. Every cs file in the picture follows this structure:



    namespace Mafia {
public class Name {

}
}


And the file name matches the class name.



enter image description here



I can access all classes in EvenEmitter, NightAction, Player, Role, Roles, Settings, Win and ActionManager.



I can access Game, NightAction and PhaseManager from every other class as well, but I can't access any classes in Game, NightAction and PhaseManager.



(This is in Player.cs VVV)





You can see, I cannot access Game, NightAction and PhaseManager from the Mafia namespace, but I can access them like they aren't in a namespace. When I hover over them I get just class Game / NightAction / PhaseManager, not class Mafia. Game for example.



(This is in Game.cs VVV)



enter image description here



(Same thing happens in NightAction and PhaseManager).



So in short, I have a lot of classes in a single namespace. However, 3 of them are acting like they aren't in a namespace.



Some things I did before the problem occurred:




  • I renamed the folder, then noticed the problem and renamed it back.


For those who say that I forgot to public them:



enter image description here



enter image description here



enter image description here







c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 7:51

























asked Nov 9 at 7:41









Mxm

237




237








  • 1




    Please share your other classes code which you can't access also. I guess you forgot to public these classes.
    – Nhan Phan
    Nov 9 at 7:48






  • 1




    @Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
    – John
    Nov 9 at 7:49










  • OP, please provide examples of these classes in your question, including their namespaces, etc.
    – John
    Nov 9 at 7:50






  • 1




    Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
    – John Wu
    Nov 9 at 7:50












  • @John added pictures.
    – Mxm
    Nov 9 at 7:55














  • 1




    Please share your other classes code which you can't access also. I guess you forgot to public these classes.
    – Nhan Phan
    Nov 9 at 7:48






  • 1




    @Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
    – John
    Nov 9 at 7:49










  • OP, please provide examples of these classes in your question, including their namespaces, etc.
    – John
    Nov 9 at 7:50






  • 1




    Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
    – John Wu
    Nov 9 at 7:50












  • @John added pictures.
    – Mxm
    Nov 9 at 7:55








1




1




Please share your other classes code which you can't access also. I guess you forgot to public these classes.
– Nhan Phan
Nov 9 at 7:48




Please share your other classes code which you can't access also. I guess you forgot to public these classes.
– Nhan Phan
Nov 9 at 7:48




1




1




@Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
– John
Nov 9 at 7:49




@Nhan Based on "but I can access them like they aren't in a namespace" it sounds more like OP has removed the namespace declaration from around them, or they're actually in the same namespace as the code where OP is using them.
– John
Nov 9 at 7:49












OP, please provide examples of these classes in your question, including their namespaces, etc.
– John
Nov 9 at 7:50




OP, please provide examples of these classes in your question, including their namespaces, etc.
– John
Nov 9 at 7:50




1




1




Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
– John Wu
Nov 9 at 7:50






Namespaces are not folders. Don't look at the folder structure; look at the namespace declarations for each class.Or use Visual Studio's Object Browser (on the View menu) and do a search for your class; it might not be where you think it is.
– John Wu
Nov 9 at 7:50














@John added pictures.
– Mxm
Nov 9 at 7:55




@John added pictures.
– Mxm
Nov 9 at 7:55












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Weird. I deleted the project from the solution then added it back and everything was fixed. Welp, thanks for the help anyways!






share|improve this answer





















  • You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
    – Grégory L
    Nov 9 at 8:33











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221599%2fcant-access-other-public-classes-in-the-same-namespace%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Weird. I deleted the project from the solution then added it back and everything was fixed. Welp, thanks for the help anyways!






share|improve this answer





















  • You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
    – Grégory L
    Nov 9 at 8:33















up vote
0
down vote













Weird. I deleted the project from the solution then added it back and everything was fixed. Welp, thanks for the help anyways!






share|improve this answer





















  • You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
    – Grégory L
    Nov 9 at 8:33













up vote
0
down vote










up vote
0
down vote









Weird. I deleted the project from the solution then added it back and everything was fixed. Welp, thanks for the help anyways!






share|improve this answer












Weird. I deleted the project from the solution then added it back and everything was fixed. Welp, thanks for the help anyways!







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 9 at 8:21









Mxm

237




237












  • You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
    – Grégory L
    Nov 9 at 8:33


















  • You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
    – Grégory L
    Nov 9 at 8:33
















You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
– Grégory L
Nov 9 at 8:33




You maybe just lost Visual studio by renaming folders. Sometime restarting VS is enough.
– Grégory L
Nov 9 at 8:33


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221599%2fcant-access-other-public-classes-in-the-same-namespace%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Academy of Television Arts & Sciences

L'Équipe

1995 France bombings