question

dncoso avatar image
0 Votes"
dncoso asked ajkuma-MSFT answered

One VS solution with a class library reference, how do i publish to azure web apps

Hi,

I know that you can not publish a solution with two projects to the same web app.

But what is the general idea? By creating a second class library project and reference this from the main app project I separate the functions in my solution. But how is this supposed to be “exported” to a published app?

With a unit test class as part of a solution I can understand that this should not be published to a web app but the library is something the main app uses.

azure-webappsvs-generaldotnet-aspnet-core-generaldotnet-aspnet-core-webapiazure-webapps-development
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The main project has a reference to the class project. The class project complies to a DLL and is copied to the main application's bin folder during the build process. Publishing the project copies the bin folder and its contents to the target machine.

Your main application should not reference the unit test project and therefore the unit test project will not be deployed.

0 Votes 0 ·

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered

@dncoso, Adding to AgaveJoe, If the library is something the main app uses it likely is already a reference in the WebApp project and gets copied with the WebApp. Publishing the WebApp only in this case should be sufficient for your scenario. If for some reason the library is not referenced by the WeApp and you are loading some other way, could you share more details on how/why you might be doing that?

See these Azure App Service docs for more info:
File structure on azure
Customizing deployments
Deployment vs runtime issues


P.S. I'd added additional tags to receive insights from the targeted SMEs/community.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.