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

No project found in the directory when run abp install-libs #19929

Closed
Huangzc88 opened this issue May 26, 2024 · 2 comments · Fixed by #19941
Closed

No project found in the directory when run abp install-libs #19929

Huangzc88 opened this issue May 26, 2024 · 2 comments · Fixed by #19941

Comments

@Huangzc88
Copy link

After restoring npm packages through the package.json file in an ASP.NET Core web project, when executing the 'abp install-libs' command in the root directory of the web project, the prompt 'No project found in the directory' appears.

image

My abp project is not a standard abp-cli-created project, but rather a self-built project based on abp modular conventions, which depends on some official abp modules and has gone through upgrades from abp 3.0 to 6.0 and then to 8.0.

Initially, there was a gulp.js file in the root directory of the web project, which I have now deleted.

Based on the documentation for client-side package copying in the newer versions, I have added an abp.resourcemapping.js file in the project root directory.

when running the 'abp install-libs' command, it prompts with an error that no project is found.

I know that there are actually project files in the path where the command is run, so I don't know where the problem lies. Do you have any suggestions?

@realLiangshiwei
Copy link
Member

My abp project is not a standard abp-cli-created project, but rather a self-built project based on abp modular conventions, which depends on some official abp modules and has gone through upgrades from abp 3.0 to 6.0 and then to 8.0

Because your project is not a standard ABP template, you need to check your project

Here is the logic code for finding projects

return Directory.GetFiles(directory, "*.csproj", SearchOption.AllDirectories)
.Union(Directory.GetFiles(directory, "angular.json", SearchOption.AllDirectories))
.Where(file => ExcludeDirectory.All(x => file.IndexOf(x, StringComparison.OrdinalIgnoreCase) == -1))
.Where(file =>
{
if (file.EndsWith(".csproj"))
{
var packageJsonFilePath = Path.Combine(Path.GetDirectoryName(file), "package.json");
if (!File.Exists(packageJsonFilePath))
{
return false;
}
using (var reader = File.OpenText(file))
{
var fileTexts = reader.ReadToEnd();
return fileTexts.Contains("Microsoft.NET.Sdk.Web") ||
fileTexts.Contains("Microsoft.NET.Sdk.Razor") ||
fileTexts.Contains("Microsoft.NET.Sdk.BlazorWebAssembly");
}
}
return true;

@Huangzc88
Copy link
Author

Hi realLiangshiwei,

Thanks for the answer, after I debugged the code, I found that it was this code that filtered the problem
image
image

and when I removed the .git from the ExcludeDirectory collection, I was able to find the project.

I know what the problem is, my web project path goes like this:

image

This path just includes the . Git, so no project files are found,I think excluding the .git handling code can be optimized to prevent exceptions because the directory contains .git

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants