jincod / dotnetcore-buildpack

Heroku .NET Core Buildpack
MIT License
750 stars 360 forks source link

can't use deploy #88

Closed mgigarf closed 5 years ago

mgigarf commented 5 years ago

The error is following

-----> App not compatible with buildpack: https://github.com/jincod/dotnetcore-buildpack

   More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure

! Push failed It's sad, that "The Buildpack will search through the repository's folders to locate a Startup.cs or Program.cs file." but my app doesn't contain any of them, and i don't know what should this files be consists of. I'm running asp.net mvc app.

jincod commented 5 years ago

I suppose it refers to .NET Framework. This buildpack support only .NET Core applications.

ASP.NET Core fundamentals https://docs.microsoft.com/en-us/aspnet/core/fundamentals/

See migration guide https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-2.2

spencerparkin commented 5 years ago

Hi. I recently had problems with jincod's build-pack for the same reasons, but finally got the deployment to work. Here's my crappy website...

https://ga-calculator.herokuapp.com/

I found the API portability analyzer helpful...

https://channel9.msdn.com/Blogs/Seth-Juarez/A-Brief-Look-at-the-NET-Portability-Analyzer

This can be used to figure out what API calls you have to stop using and find alternatives for.

Also, if you're dumb like me, you'll need to look at the properties of all your CS projects and make sure they're targeting only .net core or .net standard. If you find one targeting .net framework, then it won't work.

spencerparkin commented 5 years ago

Also, if you don't have Startup.cs or files like that, you may need to just use the config vars like I've done as follows...

image

Of course, change this to suit your needs.

mgigarf commented 5 years ago

I suppose it refers to .NET Framework. This buildpack support only .NET Core applications.

ASP.NET Core fundamentals https://docs.microsoft.com/en-us/aspnet/core/fundamentals/

See migration guide https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-2.2

yeap the problem is in framework. i'll try to rewrite app. ty

mgigarf commented 5 years ago

So i rewrote the app, i works fine local, but when i start it on heroku it crashes. i use an xml file as db(i don't need) and heroku says there's no such file, at /app/heroku_output/filename. In my program i use static string Path = AppDomain.CurrentDomain.BaseDirectory; in order to get path for file. Also it says i have mistakes in 2 my classes and in startup.cs , but they all works fine local. If it matters, i'm creating telegram bot.

jincod commented 5 years ago

Two points

 <ItemGroup>
   <Content Include="filename">
     <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
   </Content>
 </ItemGroup>

Better to use one of Heroku Add-Ons, Heroku Postgres for instance.

I think issue can be closed now