Web Deploy in Visual Studio 2013 - untrusted certificate error - c#

I have a C# MVC project in Visual Studio Express 2013. I'm using the Publish Web option and Web Deploy as the method.
After a bunch of work to get Web Deploy setup on the target machine, I finally got a valid connection:
Screenshot here (since I don't have the reputation to add the image to the post): http://screencast.com/t/Q5IccavcB1
However, when I actually publish, I get this error:
Web deployment task failed. (Connected to the remote computer ("myServerName.com") using the specified process ("Web Management Service"), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates.
The help information I find is almost exclusively for VS 2010, which isn't very helpful here. I finally tried adjusting my .pubxml file by directly adding AllowUntrustedCertificate = True in the PropertyGroup, but that has no effect.
Screenshot:
Any ideas? I'm out of them.
Thanks!

Well, it turns out that an artifact left over from trying to get an MSBuild for TeamCity working was the cause of the problem.
upgraded from VS2010 to VS2013 now I cannot publish
I added back in the PropertyGroup that I removed yesterday, and I was able to publish.

adding /p:AllowUntrustedCertificate=true argument in msbuild.exe resolve my problem
How can resolve Untrusted certificates Error ?( TFS2013 Build and deploy to IIS )

Related

HTTPS not starting in IIS when viewed from tray

I was working happily on my project. Then came a need to enable access to the server from remote machine (android) in LAN. I followed few answers on StackOverflow and they have completely ruined my project.
How to enable external request in IIS Express?
IISExpress returns a 503 error from remote machines
localhost refused to connect Error in visual studio
Earlier when I used to Debug using Visual Studio, I used to see two URLs, but I now I only see one. The debugging used to start in https://localhost:44373 but now https is just not starting and I get connection refused when I browse the https link. http link works fine.
I even tried to reset by following methods,
Deleted .vs\<project>\config\applicationConfig
Deleted IIS configuration rmdir /s /q "%userprofile%\Documents\IISExpress"
but none helped i.e. https is not starting even after using doing this as well
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44373/ -UseSelfSigned
Please help. I am getting worried. My basic intent is to enable HTTPS and enable access to this https from remote machine.
If someone knows about good server where I can deploy website and easily do this, you may suggest as an alternative, but suggest a solution to current problem as well.
Close Visual Studio.
Following this link to Remove your IIS Development Certificate.
Now, Repair IIS from control panel.
Start Visual Studio. Things will start to work

The Application is configured to use IIS (Visual Studio 2017/2019)

**Hi Guys I just Cloned my project from a repository.
I am getting this Similar error
The Web Application Project […] is configured to use IIS. The Web server […] could not be found.
I do have IIS Manager on my pc. one of the solution is to set True on my cs.proj file but when i do it auto imports a port number. when i try to run the application with that port number the application hangs(load forever).
What are possible ways to solve this error ?**
Just to register an answer for all getting into the same problem under the same scenario, as we discuss and resolve it from the question's comments:
Ps: as i said this solution works for this particular scenario, maybe anyone else has to apply a different approach!
In this case, try to follow the below link for other solutions!
The Web Application Project [...] is configured to use IIS. The Web server [...] could not be found.
Reset the IIS; (https://learn.microsoft.com/en-us/visualstudio/debugger/error-the-web-server-is-not-configured-correctly?view=vs-2019)
Publish the project;
Add it to IIS Server;
Run it using IIS Local (not the IIS Express)

asp.net core app deployed on iis meets 500 internal server error

:( Oops.
500 Internal Server Error
An error occurred while starting the application.
This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.
I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what's happened?
Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.
Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have "Development" environment.
You may use Error Handling middlewares for showing exceptions like
app.UseDeveloperExceptionPage();
Had the same issue. Here is the guide that helped me. Note, that I did not want to install the "Runtime" on the web server, but rather deploy all the necessary files as a stand alone app. Below are the steps in a more abbreviated form:
On your local PC, Determine which version to publish based on your server. I was targeting Windows Server 2008, R2 which meant i needed to publish win7-x64. Open a command prompt in your project directory and run the command below:
dotnet publish -c release -r win7-x64
This creates a publish folder containing hundreds of dlls, an .exe, and web.config located here: bin\Release\netcoreapp2.0\publish
On the web server with IIS, go to this landing page. Click the link for your desired version. Find the link for the Runtime and Hosting Bundle. Click to download and run.
Restart IIS by running this from an elevated command prompt:
net stop was
net start w3svc
Copy all of the files in your local publish folder to your desired application folder on the IIS server.
On the server, Open IIS, and create a separate AppPool and Application like normal. For the AppPool, under Basic Settings, change the .NET Framework version to No Managed Code. Make sure your Application in IIS points to your desired folder and the proper AppPool.
Test your web application in a browser.
In my case, I got this because I hadn't actually installed the latest 'DotNetCore.2.0.0-WindowsHosting.exe' on the windows server I was running it on... so it was working fine on my local machine in debug and error five hundy'ing on the server.
I had other non trivial to fix issues with the upgrade also... I'd advise avoiding it if you can.
Mark333's comment below solved my problem.
Quoting for easy reading:
"I'm using the normal publish provided by Visual Studio. And, I just
found out using the latest version of Hosting Bundle will fix the
issue. +1 on this
microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1"
I had to install for 1.1 since my app is a little older, but Hosting Bundle fixed it. In my case we deploy to a Docker image for our official environment, but when I want to do some testing locally I publish it and let my local IIS serve it up.
My problem was solved installing .netcore latest: https://dotnet.microsoft.com/download/thank-you/dotnet-runtime-2.2.2-windows-hosting-bundle-installer
https://learn.microsoft.com/pt-br/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.2#install-the-net-core-hosting-bundle
Worked like a charm!
I had installed DotNetCore.2.0.5-WindowsHosting.exe on a Windows 2008 R2 Standard machine and encountered the same http 500 error. Logging didn't help (blank logs were generated - and Event Viewer logs were the generic ErrorCode = 0x80070002)
I had to do two things to solve my problem:
Give Read rights to the ApplicationPoolIdentity user (EG: IIS APPPOOL\AppPoolIdentityName) to the website directory and the application directory
I had to install IIS ASP Core under Server Manager (this felt weird, but it worked!)
I had the same issue.
My problem was that my connection string to db was not set in appsettings.production.json
And the internal server error 500 was to vague error message.
Changing the stdoutLogEnabled = true did nothing to me so i was not seeing any information about the error.
Make sure the App Pool has permissions to the folder where your app resides.
I experienced this issue. The problem was due to my local Sql Server instance. Remote connection were not allowed. So I manually restarted the SQL instance and my App restarted working fine.
I had similar issue after istalling dotnetcore-windowshosting using chocolatey while doing AWS ec2 instance bootstrapping.
When I checked my IIS modules AspNetCoreModule was missing.
This solved my issue. https://github.com/aspnet/IISIntegration/issues/434
I had to uninstall chocolatey package, restart machine and install it again.
Hope this helps!
In my case, I created a .NET 5 single file output, and I was getting:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
The problem turned out to be that the EXE file was for some strange reason recognized as a virus by the protection software (CrowdStrike Falcon). Re-building without "single file output" option solved that problem.
There is an article called "Configuring IIS, ASP.NET, and SQL Server" which I highly recommend.
I followed the steps described there and my asp.net core app now communicates with my SQL database (after being published to IIS):
https://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
It also happens when you install dotnet-hosting-bundle/dotnet runtime beofore IIS.
In this case re-install dotnet-hosting-bundle/dotnet runtime.
To be able to see the excetion's detail I just needed to change the ASPNETCORE_ENVIRONMENT to "Development" in the "IIS Express" profile in the launchSettings.json file. I aldo needed to create the corresponding appsettings.Development.json file to set the variables and data needed in my App. When the environment is Development net core send the detail exception by defaul. As we can read here in the official documentation.

Error trying to publish my web app from VS Community 2015 to Azure. Error: Can't find existing loaded project:http://localhost:55809

This was working fine yesterday.
I made several changes to my system (updates from VS Community 15) and the Azure SDK updates, etc., - as was recommended by the software.
Today, when I right click on the web app and select Publish (using the same or manually entered public information) I see the following error on my Azure App Service Activity tab:
Can't find existing loaded project:http://localhost:55809
I have since tried other publish profiles, none seem to work.
I can successfully build and run the web app on localhost.
In Visual Studio, go to View -> Other Windows -> Web Publish Activity and you will see the Azure App Service Activity window.
Click on the Publish web icon that you will find there. It should work.
Publishing via FTP to azure instead of WebDeploy worked for me.
Change the deploy method to Ftp then change it right back to "Web Deploy". This keeps working for me
In the project folder in the website.publishproj file change the SourceWebProject tag to contain your client name instead of the localhost.
At least this worked for me :)
Update 13 Dec 2015:
Having the same problem again. The previously mentioned fix does not work. However publishing via FTP to azure works.
When you get the azure publish profile you get both Web Deploy and FTP. Try using FTP.
An update of Visual Studio Community 2015 to version 14.0.24720.00 Update 1 seems to have corrected the problem.
Update or install from here. Visual Studio Community Download from Microsoft

LibSass.x64 not found on Azure VM (virtocommerce)

I new to ASP.NET development and I have managed to deploy VirtoCommerce to my local machine IIS (windows 8.1) following the documentation on http://docs.virtocommerce.com/display/vc2devguide/Deploy+web+applications+to+dedicated+server .
When I tried to deploy it in Azure VM running Windows server 2012, I got the following error when I tried to run the frontend page. The dll mentioned below is definitely in the /bin folder of the store.
Server Error in '/' Application.
Could not load file or assembly 'LibSass.x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.**
I followed the link
Could not load file or assembly 'LibSass.x64' or one of its dependencies in VirtoCommerce but found no luck. What did I miss on this deployment ? Any help is much appreciated, thank you.
Are you running 64 but machine and IIS Application Pool as 64 bit? If not, make sure to go to IIS and configure pool settings to run as 64 bit process. The easier approach will be to follow the guide here: http://docs.virtocommerce.com/display/vc2devguide/Deploy+from+GitHub+to+Microsoft+Cloud+Azure which will setup Virto Commerce as a website in IIS with all correct configuration for IIS. You can then update it manyally by simply uploading site through FTP if you want. You can also clone the repository on GitHub and that way your azure site will auto update on every checkin.
I was able to reproduce this error on a clean Windows Server 2012 Standard. It turned out that Libsass.Net requires Visual C++ Redistributable Packages for Visual Studio 2013. After installing the vcredist_x64.exe the error has gone.

Categories