asp.netazuretfsapp-code

App_Code in local IIS and Azure/TFS build


I am using Visual Studio Express 2013 for Web & developing web APPS ( not sites ) on .net 4.5.

I build,test & view my site on a local IIS 7.5. I host on Azure - using App Services. I build and release to an App Services slot using VSTS Online

I have my classes in an App_Code folder - files are marked as compile This appears to be the only way I can set this up to work on local IIS ( or am I missing something ?) And it all works - all classes are available

But I need to build and release on VSTS/TFS ( using VS Team explorer to push) I am using the standard Azure Web App build definition module on TFS - Which takes the App_Code folder and moves it into the bin folder - but does not compile it - thus breaking the classes when they are deployed

I have tried renaming App_Code but that breaks local and still does not compile on TFS

What am I missing - how do I get TFS to either compile my classes OR copy the App_Code folder to the root ( not ideal but hey it works )?


Solution

  • In TFS, dll files will be generated under bin folder when you build a Class Library project. This is the correct phenomenon. Suggest you to create a Nuget Packages to manage your class libraries . And you can add a "NuGet Installer" task at the top of your build definition to restore the nuget packages for your solution.

    enter image description here

    If you are using vNext Build on TFS. There also has been a very detail tutorial Build and Deploy Azure Web Apps using Team Foundation Server/Services vNext Builds for you reference.