How can I publish an MVC 4 application on visual studio? - asp.net-mvc-4

When I try to publish it I get the following error message:
Error 1 Web deployment task failed. (Could not connect to the remote computer ("..*.*"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
I dont understand why is it referring me to a remote computer, I've specified the destination URL as my own IP address. And I have web management service checked on windows features.
How do I solve this particular error?

Try to publish to the file system, if this works move the files into you wwwroot, normally c:\inetpub\www.
then go to start and run inetmgr to open iis configuration manager, if you see your folder there right click and convert to application, accept settings then right click / manage / browse and you should see your site or an IIS error that should be easy to debug.
I never use the deploy to IIS feature from VS as it's pants.
Good luck!

Related

What is still missing in my attempt to host a blazor-server app?

I've been hitting my head against this wall for days now and to my knowledge I've followed every direction I've found. But I'm still getting a 500 Error when I browse to the URL.
What I've got to work with is a Windows Server 2012 R2 with IIS 8.5. I'm not married to IIS but I'd prefer not to dip into YET another tech just to get this running.
What I've done:
Old-style blazor-server app (with Program / Startup pair) without authentication. Dependencies:
SharpZipLib
LiteDB
published it using dotnet publish -o bin/publish --self-contained -r win7-x64
copied that folder to the server
On the server:
installed urlrewrite2
installed everything under Windows Features Word Wide Web Services and Web Management Tools
restarted
created a new site in IIS
set the application pool to unmanaged
set the physical path to the folder I copied from my dev system
What I haven't done:
Anything regarding Visual Studio as I'm currently forced to contend with Visual Studio Code and none of that applies/is possible here.
Provisional Workaround
running dotnet my.dll --urls http://*:1234 does work to expose the app to the network
the command needed to be run inside the application folder otherwise the app would fail to load the connection string.
I've also had to provision a production database and modify my appsettings.json accordingly
This is workable for now but not having the app "auto start" with the server is unsatisfactory.

VS2019 Cannot launch .NET Core ASP 2 web site and browse from another computer on the same network

I have been trying to browse a website run under IIS Express VS2019 from another computer on the same network. I see the following error.
Bad Request - Invalid Hostname
I found several discussions where people suggested adding bindings and I did try adding so many different bindings in applicationhost.config with specific hostname, IP, hostname+ip, wildcards. When I add any binding or modify the existing localhost binding VS 2019 start giving me the following error
Unable to connect to web server 'IIS Express'
I am running VS2019 as an admin. What else I am missing?
Here is what I discovered. I do not have admin privileges on my local PC. Our sysadmin had created a shortcut for me which launches VS2019 as an admin. However, the VS was still not run as elevated Admin privileges. Turns out, you need to be an admin, and you must right-click the VS2019 shortcut and choose Run As Administrator with a shield and say Yes to the warning. The shortcut wasn't doing none of that. Now my custom IIS Express bindings are picked up from applicationhost.config without any issue.

Windows could not start the Apache CouchDB service on Local Computer

I have installed CouchDB on my Windows machine but while starting the CouchDB service, I am getting a message like:
Windows could not start the Apache CouchDB service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, please contact your system administrator.
As the service is not running, I am unable to access Fauxton too.
I am using Windows 7. CouchDB is 2.0.0. Port 5984 is not in use.
I don't think your question is a duplicate of https://stackoverflow.com/a/44107335/219187 because you are on Windows 7, and the problem described there is for Windows 10 with the creators update.
But maybe the solution fixes your problem as well? Here is the procedure:
Download the prelease build 2.2.4-101 from https://nssm.cc/download
Stop the CouchDB service through the Windows Services dialog (paused is not enough)
Overwrite nssm.exe in <CouchDbInstallDir>\bin with the one from the downloaded ZIP file (make sure you pick the right version 32 bit / 64 bit)
Start the CouchDB service
Issue it's happening since the last updates released by Microsoft. I'm not completely aware of what's causing it, but I think it's something related to CouchDB service not been able to start using Local Administrator rights.
However I've managed to start the service manually, by doing so:
Open Command Prompt - in the Search from the Start Menu or Task Bar type "cmd"
Run it as an Administrator - right click on the Command Prompt application and choose "Run as administrator" option /this is really IMPORTANT as it will allow the service to have administrator access/
Navigate to the folder where CouchDB is install - default path is "D:/CouchDB", but could be anywhere else; you have to find it
Go to the "bin" folder in there
Type "couchdb" as a command to start the service
You will see a message showing after this - "kernel-poll not supported; "K" parameter ignored"
If it adds some error messages after it or closes the whole terminal, you're making some things bad from this guide, so follow it strictly.
You can now open up the Fauxton application in the browser like normal from here - http://localhost:5984/_utils/
Keep in mind that you have to leave the cmd opened in order the service to be working as expected. As far as I saw no information was lost, so it's all good.
This is a temporary solution though, as we are waiting a relase from either Microsoft or Apache to solve the issue, or at least give us more explanation about it.
i just met the same problem.
the cause is space, you have to install CouchDB in a path without any space, even Program Files folder, because there is a space between Program and Files...

Visual Studio 2017 Published web application returns 500 error

I have tried creating a test default net core web application which runs fine with IIS Express on my local machine. When I publish it to the server (Win 2012 R2), it returns a 500 error when I hit the website. Nothing is logged in the Event Log or IIS logs. I've installed the ASP.NET Core Module and restarted the server and still get the error. From what I've read, it's supposed to deploy a testproject.dll and web.config points to that but mine is generating an executable instead and web.config is pointing to that. Everything is in the root of the website as well so I'm not sure what else I can do. I didn't change any code in the test project, just using the default demo app to make sure I can get it running on a server.
Please help!
After a lot of testing, I finally figured out that there was a few error with IIS bindings, and permissions. Now everything is working.

Deploy WCF service to another Sharepoint server

I've created a WCF service in Sharepoint 2013 and it works great on our dev server. However, we now need to push it onto a production server and I can't seem to find any instructions on how to publish to another server.
I followed a tutorial very similar to this one:
http://www.robertseso.com/2013/05/adding-custom-wcf-services-to.html
In development, but it doesn't cover actual deployment. As per this (and other) tutorials, I deployed as a "farm" solution. If I go to "publish" in Visual Studio the option to "Pubish to SharePoint Site (Sandboxed solutions only)" is grayed out.
After a lot of searching around, I was able to piece together an answer. So in case anybody else encounters the same problem:
In Visual Studio, when you go to "Build" and "Publish..." you can "Publish to File System" (the Publish to SharePoint Site being grayed out as noted in the question). What this does is produce a .wsp file that is you packaged install file you need.
Transfer this file to your target SharePoint server and then open SharePoint Management Shell (as administrator). A list of available cmdlets can be found here:
http://technet.microsoft.com/en-us/library/ff678226%28v=office.15%29.aspx
I used:
Add-SPSolution -LiteralPath c:\<path to wsp file>\myservice.wsp
This adds the solution to Sharepoint but doesn't install it. To install you need:
Install-SPSolution -Identity myservice.wsp -GACDeployment
Note, however, that this will give you an error if the Sharepoint Administrator service isn't running (so check in services.msc first)
This add the installation job to a timer to be run at some point. You can check the status with:
GetSPSolution
Which will list all the solutions, or you can pass a name to if you want to only see the one you just installed. This will show you the "Deployed" status of the service. In my case, it was stuck of False and even after several minutes refused to do anything.
In my case, this problem was solved by going back into services and restarting both SharePoint Timer Service and SharePoint Adminstrator after which is magically showed deployed as True.