Can JetBrains Rider work properly with IISExpress? - iis-express

The JetBrains Rider I'm using is the latest version, 2019.1.2 (free 30-day trial), from the official website. It's not a broken version.
I have a solution which contains an ASP.NET web API csproj. The solution was working properly in IIS, or VS + IISExpress.
Like VS, Rider also creates some configuration files in the folder .idea. In it, I can find the applicationhost.config file for IISExpress.
The problem is that IISExpress can never start and shows me an error once I start debugging in console:
**Failed to initialize site bindings**
Error initializing ULATQ. hr = 80070005
Terminating W3_SERVER object
InitComplete event signalled
Process Model Shutdown called
Waiting for all LISTENER_CHANNELS to stop
Unable to start iisexpress.
I checked the applicationhost.config file. It's the same as the one generated by VS. It also has the line of bind info, and I'm sure the port is available:
<bindings>
<binding protocol="http" bindingInformation="*:8080:localhost" />
</bindings>
Questions: Can Rider really work properly with IISExpress? Any idea how to config it and what files should be changed?

I finally found that, in Windows 10, it seems to be a permission problem that prevented Rider from starting IISExpress properly.
Solution:
Make sure to run JetBrains Rider as admin (most important for me, then IISExpress could work!)
Open the solution, right click the web project that will run on IISExpress.
Select Properties and go to the Web section.
Check Generate applicationhost.config before running it for the first time.
The URL should be http://locahost:8080/ (8080 could be any port. Has not supported any IP yet.)
Check Anonymous authentication to allow viewing and debugging the page.
Uncheck Generate applicationhost.config after running for the first time.
Make sure Rider is still working with IISExpress without any changes in both Properties and applicationhost.config.
Only if Rider is run as admin and the settings are correct in Properties would IISExpress work properly. Otherwise, it won't start or it merely returns HTTP 5XX/4XX.

Thank you #David Smith I found Generate applicationhost.config in edit Configuration iis here
Then find this option is here

Related

Unable to load Web Application project due to its configuration

I've a problem with loading Web Application project in VS2013. This project depends on IIS Express, but I wouldn't install IIS Express because I already installed IIS.
What I can edit in .csproj file to load this project? I've tried to set to false, but it's wouldn't help me to solve problem.
Thank you for advice.
Upd.1: Also, I cannot create new web projects - VS tell me same things.
Happened to me too. My workaround:
Right-click the (failed-to-load) project => edit web.csproj
Find the line <UseIISExpress>true</UseIISExpress>, and change it to false.
Save, close, reload project.
Result - different error:
The Web Application Project web is configured to use IIS. To access local IIS Web sites, you must run Visual Studio in the context of an administrator account. In addition, you must install the following IIS components:
ASP.NET
So:
Edit again, change <UseIIS>True</UseIIS> to false
Save, close, reload project.
Result - Great Success!
Try to delete user config file "ProjectName.csproj.user" then reload project.
VS 2012 can't load project which uses IIS with custom binding host - thinks it's using IIS Express
It happened to me today. Changing "UseIIS" to false allowed to load project, but not use IIS. After some tests I've found the cause of the problem:
On previous CheckIn to VSS somehow the UAC (user account control) was switched on. So actually there were two alternatives: (i) Always use "Run as administrator" ; (ii) switch UAC off.
I prefer (ii).
I had a custom host file setup up with foo.localhost -> localhost bound on both ports for HTTP/HTTPS
checking on something i removed the host header for the binding on port 80.
once reloading solution is when everything started crashing.
found a really old post that reminded me that i removed that host name from the binding.
adding foo.localhost header back to the binding and all my projects started reloading.
If nothing works, try removing following two lines from .csproj file. (always worked for me)
<ProjectGuid>{3AA499DF-4A65-43B7-8965-D08A4C811834}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

Creating a virtual directory failed with the error

I can't solve this problem
I suggest I have to change c:\Windows\System32\drivers\etc\hosts file and add after
# localhost name resolution is handled within DNS itself.
the next line:
127.0.0.1 mysite.dev
but it doesn't help. Any suggestions?
Error ocсurrs when I try to open web site project in Microsoft Visual Studio 2012.
More often than not, at least in my case, this happens is when a *.csproj.user file is in the project directory and has <UseIISExpress>true</UseIISExpress> in it.
Alternatively, as mentioned by Zachary Cutler you can also simply: close Visual Studio, delete the *.csproj.user file and reopen Visual Studio. This will force VS to rebuild the file.
I've already found the solution. I just had to edit C:\Users\Administrator\Documents\IISExpress\config\applicationhost.config file, by adding my site to <sites> node.
You can opt to install IIS locally and edit a couple of tags on .csproj File.
Open you csproj file and go to section <VisualStudio> then find tag <UseIIS>True</UseIIS>
it must be set as true, then go to tag: <IISUrl> and set up with the URL address where the application will be hosted for testing:
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort></DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
**<IISUrl>http://localhost/myWebSiteAppSample</IISUrl>**
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
And that is. Now you can load your project normally.
The problem would be your project setup to be executed in the local IIS and the URL specified not exist.
There are options you can do to fix the problem.
Option 1 : (Use IIS Express)
1.) Open you web project .csproj file as XAML or in notepad.
2.) Find these properties and set according to your preferences.
UseIIS = false
UseIISExpress = true
and that's it.
Option 2 : (Use local IIS)
Follow the option 1 steps but change the following properties.
UseIIS = true
IISUrl = https://localhost
UseIISExpress = false
The issue can be fixed by deleting the folder named .vs in the project directory.
This solves the problem because while opening the project after deleting the .vs file, it creates the same folder with subfolder config and folder with project name.
The config folder applicationhost contains the necessary settings required to run the project successfully.
I just went to the directory named in the error and renamed the applicationhost.config and restarted and VS created a new file and ran fine.
Tried several approaches mentioned in the answers, but what finally
worked for me was swapping the <IISUrl> of .csproj with
<CustomServerUrl>.
Edit :
The above didn't solve the root cause of the issue for me. However,
If you've done a windows update recently, perhaps it might be the
reason that's causing the issue. Try executing netsh http add iplisten 0.0.0.0 and see whether it solves the issue.
Hope these would help someone still looking for a way.
I don't know why, by my applicationhost.config file was completely missing from my C:\Users\Administrator\Documents\IISExpress\config\ folder.
Copy/pasting C:\inetpub\history\applicationhost.config into that folder seemed to fix the problem for me.
Got the idea from here.
Turn on windows features "Internet Information Services" in control panel.
Open ".csproj" file and find
Modify this line based on your requirements.
http://localhost:777/
Open the project/solution now
If failed to load again, just right click the solution and select "Reload Project".
I know this is probably a rare occurrence, but figured I'd put it here:
My csproj file was set to "read only" (Don't ask me how I managed that), but after I turned off "read only" access, everything was fine. (VS2017)
Not the exact same error, but I was lead to this answer since the first half of the error matched. Your applicationhost.config file may simply be read-only. Taking that off solved the error for me. That error calls out the file specifically though, so you should be able to find it easily.
I had to somewhat combine some of the above answers. My solution was to edit (not delete) the file .vs\config\applicationhost.config
There is a section for the bindings of the site, simply change from localhost to whatever you desire to run it under. Note that the port numbers are in front of the server name.
I was able to resolve this by editing the file *.csproj in the root level of the project. I changed and from localhost to the site name as shown below. It may also be required to have the OverrideIISAppRootUrl set to True.
I was facing the same issue because of my network password changed.I changed my NetExtendor login password but I have to login in my laptop with old password.
Try these steps to fix this issue:
log into the Computer with whatever password works
log into vpn with whatever password works
ctl-alt-del to lock the pc then use the new password to unlock it
It worked for me :-)
Thanks!
So here are the steps to fix it:
Go where your .csproj file is. This is usually one directory below the solution (.sln)
Right click and open with a text editor (notepad)
Find IISUrl tag and replace its content for http://localhost:(YourPortNumber)
Save and reload your project!
My issue was with Windows 10 Defender. I had given IIS permission in the past, but seems like it is now ignoring it. Will look into it later, but for now I disabled controlled folder access and it worked.
I wanted open an exiting project of Visual Studio 2017 in VS 2019 and encountered with the same issue. I find its a version related problem. The solution is: Create a new project in the newer VS and copy the codes from the older VS.
Try decrypting the applicationhost.config file. That worked for me.
Creation of the virtual directory xxxx failed with error: Object
reference not set to an instance of an instance of an object...
Error Screenshot
This issue happened to me after deleting my local repository and downloading the repository from the cloud.
Per one of the solutions above, I deleted the .vs folder with no luck. To solve the issue, I ended up mixing a couple of the solutions in this forum.
I went to the folder .vs/SolutionName/config and pasted the applicationHost.config file from the latest subfolder on the folder C:/inetpub/history/
After that, I restarted VS and the error disappeared.
simply fix for me
Close your Visual Studio
o remove .vs in .Net
o remove IISExpress in Documents
Reopen it, everything should be fine

"application has failed to start ... configuration is incorrect" after upgrading?

I have a project in windows application than was in VS2008. Now I convert it to VS2010. When I want to run my project, I get this message:
"This application has failed to start because the application configuration is incorrect. Review the manifest file for possible error."
How to I can run my application?
Thanks.
I had the same problem where my entire C# solution was created in previous version and it did not work in new VS.Net version giving the same error. Here are a few things that will help you resolve the problem
Expand the References Item and check if any item has a warning symbol attached to it.
If (1) , click on References->Add Reference and try to add the reference which has the warning. Now the warning sign has to go away.
If the references displayed in 'Add reference' dialog box is grayed, you should probably get the reason by hovering next to the reference.
For me it was grayed and it clearly mentioned that the component is not compatible with the current .NET Target runtime. Right click on Project -> 'Properties' and try to change the .NET Runtime and give a shot by compiling the entire solution and try to execute it.
If it still fails , try looking at eventviewer logs by going to Start->Run->Eventvwr
This should be a good way to debug this problem.
Honestly...I deleted the App.config file and Re-build. And started working.
Without understanding what was going on, I was able to fix this issue for a Windows Forms project I had just converted from VS.Net 2008 to 2010.
After conversion the Target Framework was still .Net Framework 2. When I changed it to 4.0, my application could be started and debugged.
In then noticed a new line in app.config:
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
So, just for the sake of interest, I changed the Target Framework back to 2.0 and the line changed to:
<startup><supportedRuntime version="v2.0.50727"/></startup>
The application would still run.
Then, I removed the new line altogether and the application would still run!
Finally, I undid all my changes and started the conversion again. Now, the application would run immediately!
So, if you run into this issue, just try these steps and see if it helps you.
Check discussion here:
http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/e60dcbf9-c6a0-47a6-bc37-68d4edc45276
In my case the reason for this error was an invalid app.config. R# renamed the root element from <configuration> to something else (probably because there was another variable that I renamed with the same name).
I found this by following Gopalakrishnan SA'S advice to look in the Event Viewer where I found:
Activation context generation failed for "my.exe".Error in manifest or policy file "my.exe.Config" on line 3. The application config file root element must be configuration.
In my case, I forgot just a simple note,
in the requestedPrivileges you should place one requestedExecutionLevel, NOT MORE
I checked the event viewer to find the error "The application config file root element must be configuration".
It turns out it was the namespace referenced in the app.config.
I had opened it in VS 2015 after it being created in VS 2008

Trouble with 'Update Web Reference"

Occasionally I have a problem when I attempt to update a web reference in Visual Studio 2008 (this also happened in VS2005). It has happened in several different solutions.
When I have a solution with a (.NET 2.0) web service and a project that references the web service I get "There was an error downloading 'http://localhost:3890/MyWebService.asmx' Unable to connect to the remote server.". Obviously, the port number in the example is an example only, it could be any port number.
The web reference is set to 'Dynamic URL' and the web service is using the ASP.NET Development Server web server rather than IIS. When the error occurs the icon for the service never shows up in the system tray.
I have found two workarounds. The more drastic workaround is to delete the web reference and recreate it. This has worked for me everytime, but has caused some confusion for Subversion and AnkhSVN.
Recently it occurred to me to set the web service as the startup project, start it, and mouse over the ASP.NET Development Server icon on the system tray to find out the port number that it has chosen. Then, edit the port number in the WebReferenceUrl property of the web reference. After doing this I can update the web reference.
While this works I feel that there must be a better way. It seems that VS and Cassini should be able to resolve this without manual intervention. Am I missing something, or is this another case of Microsoft getting the difficult things right and the simple basics wrong?
I have attempted to search an answer for this issue and have found several threads describing the problem. But, no one has identified a real solution.
Right-click the service in Solution Explorer, and choose "View in Browser". That will cause the service to start, and you'll be able to use "Add Web Reference".
You can force the port of the test web site in visual studio.
Open the properties window in visual studio it with "F4" or via the toolbar - "View" -> "Properties Window".
Left click on your web site in the "Solution Explorer" window. Notice the drop down list for the "Use dynamic ports" setting. If you set this to "False", you'll then be able to specify a fixed port in the "Port number" field.
Set this to your desired port value.
Launch your web site. You'll see the port used matches the value you specified.
Go to project Properties-> Settings -> [Update the Service Url]
It Works.
Check appconfig file and update the port number accordingly

The Following Module was built either with optimizations enabled or without debug information

I cannot get rid of this in my VS 2008 web project when debugging. I've checked that it's in debug mode on the non-web project in question and it's in Active(Debug). Deleted all items in my .NET 2.0 temp folder in Windows. Not sure what else to do here.
Try disabling "Enable Just My Code" in Tools/Options/Debugging/Options.
I had the same problem and discovered that I wasn't outputting my debug info on my build. If you right click on the project and go to 'properties', then select the 'build' tab, on the bottom of the page there's an 'Advanced...' button that will display your setting for you output debug info. Set that to 'full' and the error should go away.
I just ran into this issue, and quickly decided that the other answers posted didn't apply to me.
I'm the owner of the project, and I know it was built with debug information, as well as without optimizations. Furthermore, I'm never happy choosing the disabling of a warning as my first choice. Hiding/ignoring this warning could become an issue in a future debugging session.
Since this only started occurring after I signed the assembly, this clued me in on my quick fix: temporarily remove the strong name of my DLL (and consuming EXE). Voila! Problem solved.
A better, long-term solution, could take the form of adding a post-build action to update the GAC so it has the latest version of the signed DLL.
But for now, I'm happy to move on from this diversion, and continue working on the issue that brought me to this debugging session.
resolved. Deleted all occurences (all projects) of the dll in question.
VS2012, clean and rebuild fixed the issue for me. "Properties" -> "Build" -> Optimize code is unchecked. "Properties" -> "Build" -> "Advanced" -> Debug Info: Full
Check out this link
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/43cb16ba-0759-42ab-8e7d-9f168ace3b6f
try unchecking "Just My Code" in Tools->Options->Debugging->General.
it works for me
Guessing VS 2008 is not rebuilding the dll correctly.
1) Delete all occurrences of the dll
2) Rebuild solution
And that should fix it.
Check your build configuration options. Make sure optimizations are turned off and the DEBUG constant is defined.
If everything else fails, try renaming the Assembly name in the project's properties. This fixed the issue for me.
I get this issue as well, for some reason it's happened 3 or 4 times; I think it must be a Visual Studio 2005 bug/hick up (or at least my installation).
This has worked every time: to fix it I
Right click on my solution and click Properties.
Open Configuration Manager.
Select Debug in the drop down menu (if not already selected).
Uncheck BUILD. Then re-check it.
Rebuild the solution.
Tools > options > Debugging > Symbols > Specify excluded modules
look that if the dll or the exe in the excluded modules list
At least for non-web applications this works:
From: http://www.stellarpc.com/articles/board.aspx?id=40
2 - Allow Debugging...
Due to the nature in which one of the assemblies has been built in your application, you will need to change a few settings to allow the code to be handled by the Visual Studio Debugger.
Right click on any project in question from the solution explorer and select 'Properties'. This will open up the project properties panel giving us access to a great many options for our projects. Navigate to the 'Complile' Tab (or 'Build' if your in a C# environment) and select 'Advanced Compile Options...' from the bottom of the screen. This presents us with a prompt that has two key areas of interest:
1) Optimizations - uncheck 'Enable Optimizations'
2) Generate debug info - Ensure that the option is set to 'Full'
I had this issue with a solution in a certain folder, but if I moved it to another folder or others built it, I didn't get the message. I did the clean, rebuild, and even rebooted and still couldn't get the original to debug without this message. I searched my system for copies of the file causing the error and I found that copies were kept in
c:\User\username\AppData\Local\Assembly\dl3
This was on Win7-64 but will be similar on other Windows OSes. I deleted all of the copies I found there and I no longer get the message. I didn't need to uncheck the "Enable Just My Code".
Also, this was for a WPF app, but I came across this thread in my search so hopefully this will help someone else.
I was able to resolve this issue by following these steps:
Right-click on the Solution (not the Project), and select 'Properties'
In the left panel, select 'Configuration Properties'
In the right panel, select 'Debug' under the 'Configuration' column for your project
If you do not see the Solution listed in Solution Explorer, follow these steps:
In the menu bar, go to Tools -> Options
In the left panel, select 'Projects and Solutions' (you may need to check 'Show all settings' at the bottom-left area of the window
In the right panel, check 'Always show solution'
I hope this helps.
I too have all these. And I've done all this. It appears this happens to me every time I get a fresh copy of the entire solution out of source control. So if we've done all these, deleted dlls & .pdb files for all references (Assemblies) in the web project, used the clean option on the solution, deleted temp files, closed out VS and reopened, made sure debug mode is selected and set at full and optimations are off, what more is there?!?!?!
I had the same issue on my web project in Visual Studio 2010, and finally I found the reason why I was getting this message. What I did was to change an existing debugging option on Visual studio:
Go to Tools->Options->Debugging->Symbols->All modules
Check the "unless excluded" radio button
Click on the link "Specify excluded modules", then remove the DLL that you want to debug.
In my case it was my web dll file...
I had this when trying to remote debug an application on a computer that belongs to a different subnet. I was able to debug and step through the code when running it across the network if the machines were on the same subnet. After changing the subnet though I was unable to step through when running from the network and was getting the "The Following Module was built either with optimizations enabled or without debug information".
The solution? Easy. Copy the built solution across to the machine hosting the remote debugging and run it locally.
Had this happen to me on a VS 2010 winForms project. Seeing that the majority of people here have web projects, i think that it has to do with access to the folder in which the project is stored. I say this because when this problem occurred to me Google Drive was synchronizing the folder in which i keep my projects. It seems that just disabling the synchronization does not fix the problem.
My solution is similar to one of the answers above:
Went to "Project Properties > Compile > Advanced Compile Options"
Checked "Enable optimization"
Set "General debug info:" to "None"
Unchecked "Define DEBUG constant"
And pressed OK
Then went back and returned the options to their initial state.
Hope this helps someone as it seems this still happens.
Follow this : (first STOP debuging)
1:right click on project solution name or project -> Properties
2:under Configuration Properties select configuration Manager
3:Change configuration to debug and click on close
4:Change configuration to debug and click on Apply -> OK
Now rebuild solution....!
For me, Checking the "Optimize code" box in the project properties, saving, unchecking it, then resaving did it for me.
Disabling "Enable Just My Code" also worked, but that was more of a work-around than a fix as I didn't want that setting.
I have had same problem, but with different cause and solution.
The window was the same as that shown by Gustavo (above) but the path was in:
"\users\zzz\AppSettings..." (where zzz is windows username)
I had an Excel addin - I was testing the install of the addin, so I had a copy installed through VS install function. VS was obviously trying to debug both the installed copy and the copy I had just launched, and could not find debug symbols on the installed copy.
None of the above solutions worked (without side affects),
SOLUTION:
uninstalling the addin, and manually deleting the files in App Settings worked.
You mentioned it's a web project...do you have
<compilation debug="true />
in your web.config?
I had the same problem after building with a Release configuration.
It turned out that when I switched back to Debug, VS wasn't detecting any differences, so it was not updating the .dll and .pdb files in the bin folder.
Here's what worked for me:
Run iisreset (to clean up the temporary folders)
Save the web.config (to force VS to actually rebuild)
Rebuild on Debug
Start the project
Try a rebuild then debug.
My case is following: webservice referenced lib1.dll. Later I removed reference as it was no longer used. However lib1.dll remained in the bin folder.
Because library was not referenced then Rebuild and Clean actions were not helpful.
After manually deleting lib1.dll from bin folder I've get rid of this message.
If you are publishing to IIS and not using built in web server -or IIS express- make sure that your publish profile settings is in debug mode. In vs 11 by default it's in release mode.
Just to add, I was looking at this blog to find the solution to the same problem I was facing. Unfortunately the solutions mentioned above didn't help me. At last I figured out, I was installing my bits (along with .pdb) through installer and setting permission explicitly on the installation folder.
Because of which VS was not able to load the pdb even though the file browser was showing the correct file but it was giving the same error mentioned above.
Once I unchecked "Enable Just my code" and removed permission settings from the installer, VS started loading the module.
The one configuration that worked for me was the following
Project --> (Your Project) Properties --> Debug Tab
make sure Configuration is set to Active (Debug)
Under "Unable Debuggers", make sure "Enable unmanaged code debugging" is checked
I'm creating a Windows Service and here's what worked for me:
Uninstall the service.
Open a command prompt and go to c:\Windows\Microsoft.NET\Framework64\v4.0.30319
installutil C:\MyFantabulusWindowService\bin\Debug\MyFantabulusWindowService.exe
Greatness has been achieved!
Case : testing assembly with Console project in SharePoint development - if you're doing SharePoint development and seeing this alert in VS, make sure you deploy your SP assembly to the GAC before testing your console app IF your core SP project has methods you need to call in your console test app.

Resources