简体   繁体   中英

Building/Running .Net Application with msbuild

I have a project written in .net 4.8 and I'm able to successfully build it with msbuild but I don't know what I'm supposed to do after this, I see there's a dll file named after the project in the bin folder as well as obj/debug but when I try to use mono to run it I get <dll_name.dll> doesn't have an entry point but I'm doing it this way only because as far as I know, it's the best way.

I was using Monodevelop for this project but I came to find out that it doesn't support async methods that return views and that it's a PR request that was merged just a few years ago so I'm think it didn't make it into the IDE.

The project runs almost fine in monodevelop aside from the prior error because it runs a command to include the namespaces as it should. Some things I've tried:

  • csc StartUp.cs which tells me there are several missing namespaces, is the only way to go through and reference all of these individually in the command?
  • mono bin/ProjectName.dll but it tells me it has no entry point and this command might not even be what I'm looking for to begin with
  • mono obj/Debug/ProjectName.dll same as above but a different file.

For reference: mono The view 'Index' or its master was not found So the PR was merged into mono but I don't believe monodevelop is using the updated version of mono, maybe if I could tell the monodevelop IDE to use the latest version?

To clarify: I'm on Ubuntu and this project won't run with the new dotnet commands so I've taken to using mono for it, my goal is to be able to build the project and then run it so I can make changes to it. I believe I already have the build part down as msbuild returns 0 errors but I'm lost after that. It's a web-based application

You should not have to invoke csc directly to build your project, but the exact cause of your problem is unclear. Instead, try building through Monodevelop or by invoking msbuild . Try posting your .csproj file if you have one. In particular, check the <OutputType> tags. Also, try doing a "Release" build instead of a "Debug" build.

Your .csproj instructs the compiler to produce a library, so that is probably why Monodevelop gives you a library. You get errors regarding dependencies with csc and mcs because they do not know about your project. Instead, use msbuild or build inside Monodevelop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM