Last post Jan 27, 2017 05:09 PM by Dmitry Sikorsky
Jan 27, 2017 12:55 AM|MedievalPeanut|LINK
Admittedly I am a newb but tried looking for the solution to this with no luck and/or I just don't know what I'm doing so I need help.
I recently started a new project going from a MVC 5 website to a new MVC asp.net Core website. I'm using the latest Visual Studio 2017 RC version since I'm not going to release until after VS is released and figured it would be a good choice.
I'm having a challenge with getting my new site setup for HTTPS and in MVC 5 it was easy to configure and I think my issue is related to the change I made and despite reverting those changes the issue persists.
In MVC 5 I would click the project and in the property pane at the bottom it had an https = true setting and then I could go into a menu for the site and update the address in another area to display https and it would convert over.
In MVC .net Core I guess this is no longer the way to do it and in researching how this is done I found something that stated I needed to go into launchSettings.json and I modified it as mentioned from my searches which stated to change the applicationUrl to
https://localhost:44300 and the ssl port to 44300 and to also change my project applicatiolUrl to
previously both were set to http://localhost:58090 and 58091 respectively and sslport: 0
When I made the change, did a build and went to run in IIS Express, IE opens and then crashes and I get the following output in the debug window:
The program ' dotnet.exe' has exited with code -2147450749 (0x80008083). The program ' dotnet.exe: Program Trace' has exited with code 0 (0x0). The program ' iisexpress.exe: Program Trace' has exited with code 0 (0x0). The program '
iisexpress.exe' has exited with code 0 (0x0). The program ' iexplore.exe' has exited with code -1 (0xffffffff).
I've looked for a solution by searching through each error and trying all sorts of suggested fixes. I've uninstalled and reinstalled IIS Express, repaired Visual Studio, gone into my project directory under the .vs\config folder and removed the applicationhost.config
file (which is regenerated the next time I run the site locally from VS) and it all continues to have the issue (again despite me reverting the settings back for launchSettings.json to their original configuration). I've even deleted the project directory
and pulled a new copy from Visual Studio Online (TFS) and went in and made sure the last version committed didn't have the new settings (which I hadn't checked in but wanted to make sure).
I created a new blank project and that seems to load okay and doesn't exhibit the same behavior and runs in IIS Express okay. So as a test I copied the contents of the launchSettings.json file and updated the name of the test application to my project name
(it didn't work), i changed the ports to new ones (didn't work), I changed the name by adding a "2" at the end of my original project name and it still won't load.
If I publish to Azure things still work but I don't have the changes for the https settings I wanted originally committed and I don't want to mess with that until I understand what I need to do to set this up right in mvc .net core.
Now after a couple of days banging my head on this wall, restoring old versions I checked in and trying to build things back up to where I was I keep running into the issue without even modifying for https. What I discovered is some messages that lead me to
removing this Nuget package: Microsoft.NETCore.App When I remove it, I get errors but the site will load and IE stay open, when I reinstall the nuget package I get the same issue.
Jan 27, 2017 01:14 AM|MedievalPeanut|LINK
and i think i figured this out...
So Microsoft.NETCore.App has a newer nuget package of 1.1.0 and the site is looking for 1.0.1 from when I built it. I'll search the site but I guess when updating nuget packages I need to update a reference somewhere so it knows to use the new version?
Jan 27, 2017 04:22 PM|damienBod|LINK
Inside Visual Studio, you can use the global.json file to set the version.
Here' a 1.1 example
Jan 27, 2017 05:09 PM|Dmitry Sikorsky|LINK
Here is one more example:
It uses the correct version of sdk, web application and other packages.