Deploying ASP.Net Project to Ubuntu server using Mono - asp.net

I have developed an ASP.net 4.5 Project using Visual Studio 2013 and I am assigned to deploy it on our Ubuntu server.
Like what other tutorials said I need to use Mono to make this possible. I think I followed those steps but when I try to open the page, it gives me this error.

I had this exception when deploying my application, but to a Windows Server. The problem was that some dlls references pointed to my local assemblies. (example: System.Web.Http.WebHost was referenced to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.WebHost.dll, so in the server this LoadException ocurred because this dll was missing.)
So the generic answer is: There is some dll missing. Compare the references in your project with the bin folder in the server. If there's some reference that points to local machine, change the property CopyLocal to true, so when you compile and publish the dll will be copied to the output directory.
I don't use Mono, but how this same problem ocurred to me in a Windows Server, may be the same problem with you in a Linux Machine.
If the probem persists, try to create a simple project, with just one page and a few dependencies just to see if the asp.net works fine in this server.

Related

ASP.Net Core 2 - IIS 502.5 Error

I am creating an ASP .Net Core (2.0) MVC application within Visual Studio 2017 which was working absolutely fine.
After turning off my computer yesterday and coming back to my application today, I now receive this browser error when I start the application in chrome without debugging.
Running dotnet run within the directory of the application, I can access the site just fine. It is just when I run it via Visual Studio/IIS Express I get this error.
HTTP Error 502.5 - Process Failure
The application builds and compiles just fine. I have also cleaned the solution.
Looking in the event logs I find:
Application 'MACHINE/WEBROOT/APPHOST/MYAPP' with
physical root 'C:\Users\Ben Hawkins\Desktop\Development Folder
\Dev\Website\Version_2\MYAPP\MYAPP\'
failed to start process with commandline 'C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Web
Tools\ProjectSystem\VSIISExeLauncher.exe -argFile "C:\Users\Ben
Hawkins\AppData\Local\Temp\tmp3547.tmp"', ErrorCode = '0x80004005 :
0.
Within my output window in Visual Studio 2017 I recieve this message under
ASP NET CORE WebServer
Failed to initialize CoreCLR, HRESULT: 0x80131534
What I have tried:
Cleaning the solution, rebuilding etc
Restarting the computer
Trying to launch another application. (Same result)
Created a new application from scratch. Same result.
Repairing Visual Studio Community 2017. Same result.
Stopping/Closing IIS Express
My setup was working perfectly yesterday and suddenly is not.
Thank you for your time. I hope we can find a solution.
We finally found the issue! After logging on to the machine as a different user, we saw a warning that the main user had ignored initially. There was a 0 byte file in the root of the directory named "Program" with no file extension. It appears that this causes some sort of issue when VSIISExeLauncher.exe is invoked through Visual Studio. (Note it would work if executed from the command prompt). After deleting the file, everything worked!
We do not know how this file was placed there for certain, but suspect it was some sort of copy error when the user was pulling in files from his old hard drive.
I don't know if anyone else will come across this, but if so hopefully this helps!
Maybe you need install previous versions of .NET Core, isn't it? I installed here and it works now. I had only .NET Core 2.0 installed and I realized that applications with 1.1 stopped so when running. In Windows' event logs I've had the same error registered.
Try to change the IISExpress to IIS by creating new IIS profile and change the Lunch to IIS. It resolved my problem.
I have hit a very similar issue with ASP.net Core 2.0. I had copied my VS project to a new one, and I was getting this error message.
After doing some research, I was able to determine that the nlog.config file was not copied into the bin > Debug > net461 folder. Once I did this, I was able to run my application.
I found it by running dotnet run from the command line on my project where the csproj files live.
Had same issue yesterday (windows 10).
Solved it this way:
Update Microsoft.AspNetCore to latest (Nuget manager - 2.1.3)
Make sure the sdk also updated to latest version. if not, update it manually from Nuget console like this:
Install-Package Microsoft.NETCore.App -Version 2.1.3
Download and install latest ASP.NET Core/.NET Core: Runtime & Hosting Bundle
from here
Same problem with version 2.2. Reinstalling .NET Core SDK fixed the problem for us.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.

ASP.NET WebForms : Unable to find ArcGISRuntime deployment folder (on server)

I have a simple .NET WebForms application with ArcGIS Runtime SDK for .NET 10.2.6.0 installed on the development machine running MS Visual Studio Professional 2013.
When I run my ASPX page locally, no issues. But when trying to do the same on the web server where I copied the project via FTP, I get the following runtime server error:
Error initializing ArcGISRuntimeEnvironment. Unable to find ArcGISRuntime deployment folder. To create a deployment run the ArcGISRuntime Deployment Tool to create a folder called arcgisruntime10.2.6
ArcGIS deployment folder VS is using on the development machine is probably within the GAC :
C:\Program Files (x86)\ArcGIS SDKs\DotNet10.2.6\WindowsDesktop\bin\arcgisruntime10.2.6
I uploaded ArcGIS DLL & deployment folder on the server via FTP as follows:
/site/wwwroot/bin/Esri.ArcGISRuntime.dll
/site/wwwroot/bin/arcgisruntime10.2.6/
/site/wwwroot/bin/arcgisruntime10.2.6/client32/
/site/wwwroot/bin/arcgisruntime10.2.6/client64/
ASP.Net page I run is at the root:
/site/wwwroot/TestPage.aspx
and the business logic CS file at:
/site/wwwroot/Content/Geometry.cs
So where the ArcGIS deployment folder has to be created if not in the /bin ? Also are client32 & client64 enough to avoid the runtime error, knowing that I haven't copied LocalServer and resources subfolders? Perhaps I should change ArcGISRuntimeEnvironment.InstallPath but I don't know how to do that.
Thanks
The runtime SDK can't be used for server side applications as it's against the licensing requirements. You need to switch to using ArcGIS Server or Portal.

Could not load file or assembly 'System.Web.WebPages' Asp.Net Webforms Navigation

I recently installed the package [Navigation] to an ASP.Net 4.5 Web Application. While I am running it on my local machine [I have VS 2012 installed] it works fine, but when I deploy to the production server I am receiving the error: Could not load file or assembly 'System.Web.WebPages'. I have added references to Syste.Web.WebPages and Syste.Web.WebPages.Deployment but no luck.
You need to set the reference to copy local so that the dll appears in your bon folder or alternatively use the "add deployable dependencies" function in vs for a better way.
the problem is your production server doesn't have the library in it's gac so you need to provide it.
Do it this way, http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx however it is an MVC project but will work for you.

Not able to access GAC assembly in asp.net Web application

I have developed an asp.net web application using .net framework 4.0.
I have installed few dlls in GAC and have added their reference in my web application , so that I can use it. These dlls are compiled in .net framework 3.5.
After development , when I published my application and deployed in my local IIS , it is working fine.
After this testing , I have deployed same content at Test server and Stage server. and also installed those required dlls in GAC.Everything is working till now.
But when I deployed same content and followed same steps at production server, it started giving me error message "Could not load file or assembly...". This is showing that my web application is not able to access that GAC assembly.
I have tried lot to solve this issue , but not able to find any solution.
One major difference I found in all environment is , the OS is installed in D: at production server, while OS is installed in C: in other environment where its working fine.
This might be causing issue. if yes, then what should be the solution for this.
I don't want to put these dlls in my BIN folder, I have tested by doing this and its working fine. I have to use dlls installed in GAC only.
Please help me .

How to add reference to Microsoft.Office.Interop.Word.dll while copying an asp.net app from dev server to test server

I am referencing Microsoft.Office.Interop.Word.dll in my asp.net web application at development server.
No i need to move this app from development server to testing server.
I can't see the dll in the bin folder of the app as it is pointing to GAC.
How should i reference the above specified dll in testing server?
Do we need to do anything with web.config?
Please advice.
Thanks,
Ram
Visual Studio uses different sets of the PIAs on the development computer. These different sets of assemblies are in the following locations:
A folder in the program files directory.
These copies of the assemblies are used when you write code and build projects. Visual Studio installs these assemblies automatically.
The global assembly cache.
These copies of the assemblies are used during some development tasks, such as when you run or debug projects that target the .NET Framework 3.5. Visual Studio does not install and register these assemblies; you must do this yourself.
Link
If not found DLL you have to download from internet....

Resources