0

I created an ASP.NET 5 Web Application. While using Class Library Projects, I got some errors. So, I added class files and wrote my business logic and data access logic. After Publishing using Visual Studio, the Output folder contains the actual source code and compiled DLLs are not present. How can I share the compiled files with my client for deployment and not the actual source code?

By selecting the Produce outputs on build in the Build option, a DLL is generated. How can I use this DLL with DNX command for hosting?

In one of the sites, it was mentioned that we can Pre-compile the Web Application. How can this be done?

Bala Sakthis
  • 664
  • 1
  • 8
  • 20

1 Answers1

0

Step 1: Ensure the Produce Outputs on build is checked in the Build Option. (Only if this option is checked, the DLL files will be generated.)

Step 2: Build the Web Application in Release mode.

Step 3: The compiled DLLs will be present in: ..\artifacts\bin\WebAppName\Release\dnx451.

Step 4: The generated DLLs can be checked using ILSpy.

Step 5: Select the Web Application and click Publish.

Step 6: Go to the published path: ..\approot\src\WebAppName and delete all the Class files which were compiled into DLLs (after verifying Step 4). If ViewModels are used, those files should not be deleted as they will be used in Views (Refer Step 8).

Step 7: Copy the DLLs generated in Step 3 and paste in the published path: ..\approot\src\WebAppName.

Step 8: Move all the ViewModel files into the Views folder.

Step 9: Open Command Window in the location: ..\approot\src\WebAppName.

Step 10: Type dnx --lib "..\approot\src\WebAppName" web in the Command Window and click Enter. (Enter the path where the Command Window is opened.)

Step 11: Now, the Kestrel Server is Up and you can browse the Web Application by visiting http://localhost:5000/

Note: DNX is being retired in favor of the new .NET Core Command LIne (CLI) Tools.

Tip 1: To view the application from a mobile device, please check: Viewing localhost website from mobile device.

Community
  • 1
  • 1
Bala Sakthis
  • 664
  • 1
  • 8
  • 20