Web Deployment Error on publishing VS2013 solution - asp.net

Hi am getting the following error when publishing this particular MVC application running on .netframework 4.5 to IIS7 (windows 2008)and IIS8 (windows 2012 )servers;
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4077,5): Warning : Setting both property values of DeployAsIisApp and IncludeIisSettingsOnPublish to true is not recommended, as IncludeIisSettingsOnPublish is a superset of DeployAsIisApp
Transformed Web.config using E:\INSPNIA_WB0R5L90SUPDATED\INSPNIA_WB0R5L90S\MVC5_Full_Version\PCA\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Views\Web.config into obj\Release\CSAutoParameterize\transformed\Views\Web.config.
Auto ConnectionString Transformed obj\Release\TransformWebConfig\transformed\Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Adding sitemanifest (sitemanifest).
Adding appHostConfig (Default Web Site/PCA).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4270,5): Error : Web deployment task failed. (Source (appHostConfig=Inspinia_MVC5) and destination (appHostConfig=Default Web Site/PCA) are not compatible for the given operation.)
Publish failed to deploy.
any help on resolving this will be appreciated. NB i have other solutions that are using the same framework and they are able to publish successfully hence i think it is a problem in the specific slution but am not able to figure out the exact issue

for the sake of someone who might experience the same....this worked for me
Replaced the following XML tags in the csproj file
<UseIISExpress>True</UseIISExpress> with <UseIISExpress>False</UseIISExpress>
<UseIIS>False</UseIIS> with <UseIIS>True</UseIIS>
<IncludeIisSettings>False</IncludeIisSettings> with <IncludeIisSettings>true</IncludeIisSettings>

In your solution explorer, right click your web application > Properties and then check your items to deploy. Uncheck(include IIS settings as configured in IIS Express).
You might also try deleting everything from your bin and rebuilding.

Related

The IIS Express applicationHost.config file contains invalid entries

I am getting this error while creating a new web application project after a fresh install of VS2019.
Please see the details: The IIS Express applicationHost.config file contains invalid entries
and must be corrected before you can open project xxxxx'
xxxx is for what it shows enter image description hereat the end'
So I found a solution for my own problem as it escalated to crashing various MS apps like Visual Studio, SSMS, etc.. – that are calling the .Net framework; therefore, my last resort was the laptop needed a factory reset. Clean slate everything.

You do not have permission to access the IIS configuration file - Web app error

I am trying to load existing c# web applications and getting below errors while loading any web project:
Creation of the virtual directory http://localhost:/ failed with the
error: You do not have permission to access the IIS configuration
file. Opening and creating web sites on IIS requires running Visual
Studio under an Administrator account.. You will need to manually
create this virtual directory in IIS before you can open this
project.
The following error occurred when trying to configure IIS Express for
project xxx.WebApi. You do not have permission to access the IIS
configuration file. Opening and creating web sites on IIS requires
running Visual Studio under an Administrator account.
I tried following, but in vain:
Running VS 2017 pro as an administrator.
I ensured that I have access to %systemroot%\System32\inetsrv\ and C:\Windows\System32\inetsrv\Config folders.
I have installed all IIS compatibility windows features through control panel.
Restarted IIS manager.
Created virtual directories.
Changed registry path of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal from u:\ to C:\Users\MyUser\Documents.
Uninstalled IIS Express 10.0 from control panel and reinstalled it through VS2017 installer by clicking – Individual components – cloud, database server – IIS Express.
Repaired VS 2017.
Got admin access on machine.
Created new empty web project but getting same error while new console app runs without errors.
Restarted machine after every installation related change.
All the solutions tried are mentioned on stackoverflow but are not working for me. Is there something trivial that I am missing? Please guide me to crack these IIS errors.
I was able to solve this issue doing the following:
1- Go to C:\Windows\System32\inetsrv and double click on directory config and accept the warning message.
2- Go to C:\Windows\System32\inetsrv\config directory and double click on directory Export and accept the warning message.
Then you will be able to run the app in your local IIS without being an administrator. You can follow the path in the given Image.
This solved the problem for me with Visual Studio 2017, .Net Core 2.2 and IIS Express 10.
You need to ensure devenv.exe has sufficient permissions. You can find it at:
C:\Program Files OR Program Files (x86)\Microsoft Visual Studio nn.n\Common7\IDE
Right click on the exe, select Properties, Security. I gave Administrators full control as I'm running VS under admin.
My Simple solution was to right click on Visual Studio and click Run as Administrator. But a solution above tells you how to have Visual Studio always run without having to run as an administrator.
All these solutions could not work for me. The issue was, I have accidently uninstall IIS from control panel even it was install and showing me. but was removed from control panel. I reinstall IIS latest version and able to fixed the problem. This might help for others.
This link help me
VS2017 RC - The following error occurred when trying to configure IIS Express
The issue for me was caused when I modified my project to override application root URL. After a push/merge and new branch my project would not load any longer. reverted the changes and all is well again.
Open an elevated command prompt and enter the following command to substitute a drive path for U drive.
c:\windows:\system32> Subst u: C:\Users\MyUser\Documents
I had replaced ‘U:’ path in registry with ‘C:\Users\MyUser\Documents’ previously. I think that was not sufficient. Some references of u:\ might have been hindering IIS.
The total substitute command must have replaced all references and the IIS config error got resolved. Hopefully, now I’ll be able to load my web apps.
I had the same issue, but instead of the workarounds (such as first double-clicking certain directories each time or running the security risk of always having to always run my VS as administrator), was able to permanently resolve the issue by deleting the "ProjectName.csproj.user" file and that fixed it. I guess there was some incompatible setting in the user file that VS couldn't deal with.
For older versions, change the option from IIS to your solution name, before clicking on the green play like run button, to build and run the application.
We resolved this by removing the project and adding it back.
If you're used to run your Visual Studio via shortcut with 'Run as administrator' checkbox marked, double check it is indeed still selected. For some reason mine had unchecked itself resulting in inability to load an IIS project. I was 100% sure my VS had these administrative privileges as usual, which made me try all the Internet proposed solutions except for the most obvious one.
Restarting Visual Studio worked for me.

XML Parsing Error: no root element found in iis

I am very new to web services. I have wrote a web service application. When I run it from visual studio, everything works fine and my local website comes up. But after I deployed it in IIS, I can't browse it from iis and i get the following error! I am confused about this error for a day! Can some one help me?
XML Parsing Error: no root element found
Location: http://localhost:99/WebService.asmx
Line Number 1, Column 1:
I faced a similar issue when I deployed a project on my local new computer. By default, ASP.NET is installed but disabled in Windows.I had to enable it before my project run. See Install IIS and ASP.NET Modules for details.
Make sure that all the required modules are enabled.
I had same issue, but had ASP.NET modules installed. Apparently had to change .NET Framework Version from v2.0 to v4.0 and site was showing as it should. You need to go to IIS, Application Pools, double click the one that has older version of .NET and set the relevant one. Maybe this will be helpful for someone else.

Unable to access the IIS metabase

An ASP.NET web project loads with up the solution, but I get this error
The Web Application Project is configured to use IIS. Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
How can this be solved?
This may have nothing to do with registering ASP/IIS. The reason is exactly what the error message says: Visual Studio devenv.exe is not running with sufficient privileges to access the IIS process, and it needs to do this if your solution contains a web project whose Web settings say to use IIS rather than the VS dev server.
There are two solutions to your problem:
Run VS as an Administrator and reopen the solution/project.
Edit the web application's project file with a text editor and change this line
from True to False:
<UseIIS>True</UseIIS>
That will stop it using IIS and demanding higher privileges.
The reason VS demands Admin privileges is, I believe, because it will try and create the IIS web site for you on demand if it doesn't exist.
An answer that worked for me can be found here:
https://stackoverflow.com/a/17460774/3005965
Basically, go to %systemroot%/inetsrv/config. When prompt appears saying you need admin privileges, click Continue.
This should clear up your issue.
Just try to access Visual studio as Admin right click and choose run as administrator.
may fixes this problem.
and take a look at this link for instructions on creating a shortcut.
I ran into this problem when I had copied a project to a new project. I opened the project file (.csproj) and removed the value from the IISUrl element:
from: <IISUrl>http://localhost:21222</IISUrl>
to: <IISUrl></IISUrl>
Have you registered the .NET framework with IIS? You need to run the aspnet_regiis.exe utility found at %WindowsDir%\Microsoft.NET\Framework\vx.y.zzzz\. Run it as administrator as follows:
aspnet_regiis.exe -i
-i : Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below. Only the script maps for applications that use an earlier version of ASP.NET are updated. Applications that use a later version are not affected.
Find out more about the utitlity here.
This error also occurs if you modified your Machine.config and added some "invalid lines":
For example, I added some appSettings, to the configuration section (which IIS didn't like).
Just register your Web-project in your local IIS. All the settings you will find in *.csproj file. That works for me.
first uncheck internet information service from turn windows features on or off.
then uninstall iis from your system and restart it. after restarting it install iis again from https://www.microsoft.com/en-us/download/confirmation.aspx?id=34679 and try to open again.
Step 1: Close Visual Studio
Step 2: Go to Project Folder and find ".vs" folder Note: It may be hidden
Step 3: Delete ".vs" folder
Step 4: Open Project Again

How to publish Asp.Net WebService with debug information?

Starting with asp.net 2.0 the debug=true in the compilation section of the web.config file is deciding if the website/webservice will be compiled with debug information or not. But the compilation output is a lot of "gibberish" under the ASP.Net Temporary files. Only wiht publish i can get a clean output to be properly hosted under the WebServer. But there are no pdb files even if debug=true in the web.config.
How can i possibly get the webservice to compile clean (as with publish) but with debug information as well? My purpose would be to publish the debug output on a remote production webserver and be able to debug into it.
"Web Deployment Project" solved my problem. It plugs into Visual Studio and allows setting extra deployment options, including publishing with debug information.

Resources