heldersepu / Swagger-Net

Seamlessly adds a swagger to WebApi projects!
BSD 3-Clause "New" or "Revised" License
144 stars 42 forks source link

App_Start not found #123

Closed Afsalmc closed 2 years ago

Afsalmc commented 2 years ago
At C:\Users\afsalrahman\.nuget\packages\swagger-net\8.4.14.1\tools\Init.ps1:3 char:1
+ $SwaggerConfig = $project.ProjectItems.Item("SwaggerConfig.cs").FileN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

App_Start not found

I'm getting this error. I have App_Start folder in the root of my project

heldersepu commented 2 years ago

that error is from here: https://github.com/heldersepu/Swagger-Net/blob/master/Swagger.Net/Nuget/Tools/Init.ps1#L24-L33

try
{
    $AppStartDir = $project.ProjectItems.Item("App_Start").FileNames(1)
    MoveConfigFile $AppStartDir
}
catch
{
    Write-Host "App_Start not found! "
    #Write-Host $_.Exception
}

something failed there you could also move the file manually... ...maybe that file was already there?? is the swagger page loading?

Afsalmc commented 2 years ago

There was no config before, right after that I tried manually copying the file and it solved my issues. Reporting this event for further improvement to this awesome project.