Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble adding a new entity to an existing project #97

Open
MetalHexx opened this issue Sep 9, 2022 · 6 comments
Open

Trouble adding a new entity to an existing project #97

MetalHexx opened this issue Sep 9, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@MetalHexx
Copy link

MetalHexx commented Sep 9, 2022

I am following your tutorial. All went well until I hit the step to add the ShoppingListEntity. It's saying it can't find the .sln file even though it's there. Nice project! Good conversation today! -wpereira

Steps to reproduce

Here is the output from the console:

$ craftsman add entity ShoppingListEntity.yaml
Error: A solution file was not found in your current durectory. Please make sure you are in the solution directory for
your project.

$ ls
CarbonKitchen.sln README.md RecipeManagement SharedKernel ShoppingListEntity.yaml docker-compose.yaml

@MetalHexx MetalHexx added the bug Something isn't working label Sep 9, 2022
@pdevito3
Copy link
Owner

pdevito3 commented Sep 9, 2022

Hey, thanks!

The add entity command should be run from the boundary folder (has your src and test directories), but it does check if you have a sln file in the parent directory, so that's probably what you're seeing. Mind trying that and letting me know?

@pdevito3
Copy link
Owner

pdevito3 commented Sep 9, 2022

FYI, updating error messages to be better here

@pdevito3 pdevito3 closed this as completed Sep 9, 2022
@MetalHexx
Copy link
Author

The command worked this time when I ran it from the boundary folder and seems to have generated the expected files. The first time I ran it, it was from the same folder as the .sln file (see the "ls" console output above for the directories and files in the current folder). The boundary folder doesn't have the .sln file, so the new error message is still a bit misleading. Maybe some clarity in the tutorial will help.

However, I ran into another issue. It rendered the new feature classes with a typo in the using namespaces. For example, ShoppingListItemsController.cs was generated with a using statement declared as "using recipemanagement.Wrappers;" where it should be "using RecipeManagement.Wrappers;" Seems like a typo across most or all the files that were generated which created a bunch of errors.

But I figured out why that happened. When I entered the folder using "cd recipemanagement" Powershell brought me to a correct, but lowercased version of the correct directory "C:\dev\src\wrapt\carbonkitchen\recipemanagement". Weird! That's when the generator fails. It leads me to believe you're sourcing the namespace from the directory name at the time the command is run. So I blew away the entire solution and ran it again. I navigated to the boundary folder, but this time with the correct casing "cd RecipeManagement", and it generated everything properly. I did the whole thing one more time with a lower cased directory name and I was able to reproduce the problem. I reckon others might run into this. I can send you some screenshots later if you want.

Great tool though man, very impressive.

@MetalHexx
Copy link
Author

MetalHexx commented Sep 10, 2022

here is the console output to show you what I mean by the strange lowercase directory issue:

PS C:\dev\src\wrapt\CarbonKitchen> cd .\RecipeManagement
PS C:\dev\src\wrapt\CarbonKitchen\RecipeManagement> ls

Directory: C:\dev\src\wrapt\CarbonKitchen\RecipeManagement
d----- 9/10/2022 12:32 PM src
d----- 9/10/2022 12:32 PM tests

PS C:\dev\src\wrapt\CarbonKitchen\RecipeManagement> cd ..
PS C:\dev\src\wrapt\CarbonKitchen> cd recipemanagement
PS C:\dev\src\wrapt\CarbonKitchen\recipemanagement> ls

Directory: C:\dev\src\wrapt\CarbonKitchen\recipemanagement
d----- 9/10/2022 12:32 PM src
d----- 9/10/2022 12:32 PM tests

@pdevito3 pdevito3 reopened this Sep 10, 2022
@pdevito3
Copy link
Owner

Ooo, that is interesting. Never seen that one before, but your hunch sounds right.

Appreciate the insight and the kind words!!

@MetalHexx
Copy link
Author

np -- good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants