Attempting to install NuGet server on iis 10 on w2016 yields 404 not found error - iis

My environment:
Windows 10 Creator (1703 with current updates to this date)
Visual Studio 2017, Enterprise, 15.3 with most of the goodies turned on.
Windows 2016, again with all current updates.
iis 10 with WebDeploy installed (that's a whole other installation nightmare, suffice it to say that SO helped there and the answers are already out there so I won't go into it here). Turned on ASP.NET 4.6, otherwise mainly accepted the defaults.
My process:
As per the NuGet.Server documentation, create a new ASP.NET MVC project using the "Empty" template and download and install NuGet.Server as specified. I'm using .NET 4.7 as my framework.
Compile and configure as desired (at least ensure you have an api key in place).
Deploy to iis using the "Publish" | Web Deploy option
Try to get in touch with the NuGet.Server on the website and fail miserably!
My bindings are 192.168.1.25 (yes, the server has a fixed IP address), port 80. The name of the site is AWENuGet and the desired url is www.awenuget.com.
To be sure, all of this works just fine if you take the same project as described above, assign a local port number (creating the project will do that anyway) and then simply running the application in Visual Studio works just fine.
But, when I took that self-same project and simply deployed it to iis, miserable failure.
I tried to open the host file (Windows\System 32\drivers\etc) and added the following:
192.168.1.25 www.awenuget.com
to said file and it still failed.

...and the answer, for me, was to take that same hosts file entry that I made on the server so that the server could see it and install it in my dev machine's hosts file and voila! NOW it works just fine.

Related

.Net core 3.1 sudenly stoped thowing HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

Everything was fine until yesterday. This must be due to Windows update. No one touched the server. I have tired couple of similar solutions posted in Stack Overflow(all are old questions),none of them worked for me. What I have, Server Windows server 2019, APP netcore 3.1 ,IIS version 10. .net core runtime and SDK both are installed. This was working before. No one touched anything, just stopped working
In the browser appearing
HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
When I executed on the command line
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in
When I checked event log. Something like below appeared. But let me tell you in the build
directory we don't have a file like app.runtimeconfig.json
What I have tried
Repair .netcoe runtime and SDK
Restore old DB backup
Reinstall .netcore versions
No pending Windows updates
Restart IIS APP pool also the server
Check file permission
None of them worked for me. If anyone can help, really appreciate.
For this issue, we can't find out that the environment of windows server caused by windows update is abnormal. As you said, it worked fine before.
So please allow me summarize below suggestions as answer.
Suggestions
Copy the publish file named original_file . And paste it in our dev pc or other server which have IIS Management. And test it, this publish file should be works. This step just confirm the publish file is normal.
Create a new website and a new application pool. Create a new asp.net core3.1 application and deploy it. Then check if it works properly under this new site.
The site should be fine in the second steps, and replace it with the original_file. And the application also should be works fine.
The site can't work in the second steps, it means the environment in you server has some problem. It could be registry issue or ApplicationHost.config issue in IIS and so on. If it's very important for you, you can rasie a support ticket and let official engineer help you to figure out what happend in this windows Update
After the third step, if the new site can run the original_file file well. We can compare ApplicationHost.config between the new site and the original one to see if any settings have been changed.

IIS does not start .net core 1.0 executable

so after .net core 1.0 got published I started a new console project and imported the code from a small prototype that is supposed to run without IIS. Besides having to use net46 in my project.json due the not-yet updated MongoDB.Driver, that worked fine. When I build the app in Visual Studio a small App.exe with a lot of dll is build and can be run fine locally without IIS.
I then noticed the option to build for IIS Express and thought that I can use the IIS on our server (IIS 6.2, Windows Server 2012 R2) too. It publishes fine with WebDeploy, but nothing happens after that. I was following this official guide. I installed the .NET core Windows Server Hosting bundle and everything appears to be in order, but when I browse to the url, I get a ERR_NAME_NOT_RESOLVED. Theapp.exedoes not appear in the Task Manager and I can't find any log file, although it is enabled in theweb.config. I can execute the app manually, but then it only listens on the defaultlocalhost:5000` address.
If I understood it correctly, the IIS is supposed to act as a reverse-proxy to the dotnet tool which starts a dll, but in my case it's already a compiled exe that works standalone. But I can't figure out how to build a dll from this app..
What am I doing wrong?
If you target full .NET Framework the application will be .exe and not .dll and it is fine. ERR_NAME_NOT_RESOLVED indicates that the url you provided in your browser could not be resolved and the request to the application was not made. AspNet Core Module starts the application on the first request and because the host could not be resolved the request was not made and the application was not started. Once you figure out why the name could not be resolved and you still have issues with making your application work with IIS take a look at my post which explains how things work and how to troubleshoot issues. This, however, only applies after the request can reach your application.

Windows 10 ERR_SSL_PROTOCOL_ERROR when enabling SSL

My office just gave me a new machine with Windows 10 and both VS2013 and VS2015 installed. I transferred an existing VS2013 project to the machine, but when I attempt to run, I get a ERR_SSL_PROTOCOL_ERROR error in Chrome. There doesn't appear to be a Repair IIS Express application in Win10. I considered uninstalling IIS Express 10 and install 8, but I'd need to get permission for that and it wouldn't be an easy sell. What else can I look at?
I couldn't find a solution anywhere online that would help me out until I removed the bindings that I was trying to access via the IIS site bindings in IIS manager - see below :
This was the only binding I kept - I removed the other bindings which were pointed at the ports that I needed.

MSDeploy - Cannot deploy .NET v4.5 package to v4.0 Application Pool

After migrating TeamCity from one server to another, and also switching to Visual Studio 2013, our build fails when using MSDeploy to push a TC-built .zip package to IIS.
The application pool that you are trying to use has the
'managedRuntimeVersion' property set to 'v4.0'. This application
requires 'v4.5'
This is a strange error since my IIS server has .NET 4.5 installed and has been happily running and being deployed to for weeks, and a 4.0 application pool will run a 4.5 targeted app.
Unfortunately, the waters are muddied by the changes to TC and VS (2013) so what caused the issue I cannot be sure of.
Note: Our TC server only has Visual Studio 2012 on it, since I'm on MSDN and got early access to 2013. This could be the culprit, but doesn't make the issue any less odd.
I'd prefer not to disabled .NET runtime version checking at all (with IgnoreDeployManagedRuntimeVersion), but instead implicit set runtime version via DeployManagedRuntimeVersion:
<DeployManagedRuntimeVersion>v4.0</DeployManagedRuntimeVersion>
Some more details: http://techblog.dorogin.com/2013/11/deploying-45-projects-with-webdeploy.html
Open your .csproj file and set the following element:
<IgnoreDeployManagedRuntimeVersion>True</IgnoreDeployManagedRuntimeVersion>
Adding it just above this element helps readability:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
Kudos to https://stackoverflow.com/users/1769923/abhishikt-n-jain for answering with this little-known config setting here:
MSBuild deploy failing after upgrade to .NET 4.5
If anyone knows why this happens, please feel free to add an answer.
Update
Disregard my comments below. While it got me past the deploy, I got a 503 Service Unavailable when I actually tried to run the web app. I backed out this change by setting the managedRuntimeVersion property back to v4.0 and added the IgnoreDeployManagedRuntimeVersion to my project. Then the deploy succeeded and the app worked. Dumb...
This happened to me after I installed .NET Framework 4.5.1 on a Windows Server 2008 R2 SP1 machine (as part of upgrading Powershell).
The IIS user interface on Windows Server 2008 doesn't give the option of setting the managedRuntimeVersion property to v4.5 even after that version is installed. However, this can be done on the command line using the appcmd utility as #3boysdad's answer shows.
appcmd is the command-line equivalent of managing IIS sites, apps, apppools, etc. It is located at %systemroot%\system32\inetsrv\appcmd.exe but it is not on the PATH as the following link explains:
http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe#HowToUse
I'm of the opinion that modifying your project (via the IgnoreDeployManagedRuntimeVersion or DeployManagedRuntimeVersion properties) is sub-optimal. The application pool should be set to use v4.5, and the only way to do that on Windows Server 2008 is to use the appcmd utility. #3boysdad's answer should be the accepted answer.
found this gem while hunting around for this same problem.
appcmd set apppool /apppool.name: <your app pool> /managedRuntimeVersion:v4.5
this will need to be executed in your \System32\inetsrv directory.

Debugger can't connect when starting local azure project

Ok, first of; here's what I did:
Install AZURE tools
Reboot
Start Visual Studio - new Azure project
Add web role (asp.net MVC 4 beta web role)
Hit F5 (debug)
It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn't connect.
Then after some googeling I'm suggested to try to run the application without running the debugger to see if I can acces the application. When I do I get this:
So I figure that IIS does not have permissions to access some file/directory. So I go to IIS and look up the application pool running the app, and it tells me that the identity in use is NetworkService, then I go give NetworkService full permissions to the entirety of the folder IIS has set for the application (which also happens to be the path to the project dir). Still I get the same error. Now I'm more or less out of ideas, but I try one last thing, which is to also give IUSR full permissions to the same dir, but this did not help either.
How can I go about resolving this problem? I haven't tried actually launching my project to Azure yet, cause if I can't even get it to work in development I don't see much point. Any and all help would be appreciated.
I ran into the same error today after uninstalling .NET 4.5/Visual Studio 11 Dev Preview, then installing ASP.NET MVC 4 Beta (this is before Feb 29th when the updated VS 2011 Preview drops).
Since I uninstalled .net 4.5, you just need to do an "aspnet_regiis -i" to ensure the .net framework (4.0) is set up with IIS 7.x this worked for me.
Edit: This will work if you uninstall/then manually install Visual Studio 2012 RTM as well.
I had a similar error yesterday. For me the problem was that the output of the build was empty in the target folder.
I tried to answer a similar question https://stackoverflow.com/a/9411422/182371:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log
file for the error messages. Mode details at
https://stackoverflow.com/a/8432621/182371
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0', right
click --> Explore.... Make sure that this folder is not empty and
contains all the files required to start a web project successfully.
As for the Access Denied error:
it could be just an IIS default setting to disable browsing. To resolve that, just navigate to that web site in IIS, find Directory Browsing icon, and press Enable. You will at least see the files inside that directory.
Also try not only 127.0.0.1:81, buta specific document inside that folder, like 127.0.0.1:81/Default.aspx
Take into account the fact that there's sometimes some mess with the ports. You see that in the error message it's port 82, but in your browser it's port 81. So make sure you're using the right port. Or, even better, in your service definition try to use some non-standard port for this to avoid remapping.
I've met the same issue. In the end, I had to reinstall IIS 7.
I got this exact same error and tried a re-install of IIS and the Azure SDK - nothing worked.
Eventually tracked it down to the "IIS URL Rewrite Module 2". I went to the Control Panel and chose Repair and it resolved it. If you have a section in your web.config then this might be the cause.
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk when upgraded from 2011.

Resources