I have built my first ASP.NET web API in MVC, when I debug the application from Visual Studio everything works perfectly.
Now I need to get these API's on my server...
I have tried copying the project files to the website root which usually works for normal MVC apps with views, and I have also built the project and copies the file full of DLL's and an exe to the IIS root.
Obviously, neither of these worked, anyone know what I am missing? Perhaps something I have to do with IIS?
I have now tried "publishing" the project and when I try to access the site this happens...
Thanks in advance!
Build the application then publish it. Copy the published files to a favorite IIS folder. Ensure you select the right version of ASP.NET in the server for your application in the application pool.
When you publish and get an error such as this it is often related to a configuration issue, or other non-supported .NET Runtime issue.
For best results, if you can get to the Event Viewer for the server a detailed error should appear there outlining the root cause of the issue.
If you don't have access to the server directly, updating the <system.webServer> section with the below should get you a detailed error.
<httpErrors errorMode="Detailed" />
Just please note DO NOT LEAVE THAT LINE IN PRODUCTION!
Related
I migrate an dotnet framework web api application from vs 2010 to 2019.
I want to use IIS express for developpement mode debug.
My application is built with a api back in dotnet framework 4.5 using xml and not json and a front in dotnet winform.
sorry for the french messages.
thanks a lot for your suggest.
I've been stuck with this for a week
Vincent
I tried to change the web.config, the applicationhost.config (in the user iis express directory and the .VS\config directory.
add modules to IIS manager
Try removing this line from your web.config,
<identity impersonate="true"/>
Or,
as Described in here;
Your application's Web.config file specifies "identity
impersonate='true'".
In IIS 7 Integrated mode, client impersonation is not available in
some early request processing stages. Therefore, IIS will generate the
migration error message. If your ASP.NET Web application impersonates
client credentials (most common with intranet scenarios), you may want
to set the validateIntegratedModeConfiguration attribute to false.
Add this section to your config to overcome this issue,
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
thanks for your help
I have tried
validateIntegratedModeConfiguration="false"
and it worked only when I deleted the lines created in the applicationhost.config (but it's not a solution)
we finally found: the problem was that I modified the .csproj file; but the file used for the user configuration is the .csproj.user.
It is modified with the "property" tab of VS.
I had seen it in a post for an mvc web application, since we are using an api, I thought it was different because it is an api.....
My colleague showed me the options in the panel... and now it works!!!!
[]You have to modify in properties :
anonymous authentication : disable
windows authentication : enable
pipiline mode : classic
and that's all
Make sure all the following .NET modules are installed.
.NET SDK 6.0.100
.NET Runtime 6.0.0
.NET hosting 6.0.0
note that the above are the current versions the versions may differ.
also change the version of .config files by running as Administrator whether you open the .json on Notepad or your IDE.
make sure your Internet Information Services is up to date and have selected all features on IIS
I have almost no experience with MVC, so hoping someone can help me. I have already spent hours trying to configure IIS to run the applications.
The application runs fine in Visual Studio 2010. MVC2. I can configure the publish and publish output seems to work fine. I have configured IIS as I have many times, but more for a non-mvc .net application.
When uploading the application to the IIS directory I only receive 500 errors. The IIS log doesn't give me much info to work with.
For grins, I created a new MVC project and uploaded that started app up to IIS and received same IIS 500 error. This leads me to believe I've configured IIS incorrectly. The only thing I'm confident of is I've screwed up somewher.
Any and all help is very appreciated!
Screenshot for Trace:
click here to see screen shot of trace error.
Detailed trace Image
I assume the problem is you are hosting your web app in a folder by mistake. You didn't set in the root web.config of your web-application or website. It looks just like you are hosting your application in a virtual directory or a sub-folder.
As you can see its only <modules runAllManagedModulesForAllRequests="true" /> is only supported by root web.config or applicationhost.config.
Modules section is not listed in folder(Vdir) level's web.config.
So please ensure you are publishing your application to a site's root folder or a sub application.
https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/application/
I'm trying to deploy an ASP.NET application to localhost using IIS, I've been reading a LOT of tutorials and following them step by step but I just can't seem to make it work...
I created an Application Pool(TestPool) with .NET version 4.0 and gave it every permission to the folder where the application is at.
I then added an application to the Default Web Site and tried to run it at
http://localhost/TestApplication/
But I keep getting:
Any idea what is wrong and how can I solve this?
Versions:
IIS version: 6.2
OS: Windows 8.1
VS 2013 Ultimate: 12.0
VS .NET: 4.6
PS: It's my first attempt at deploying an ASP.NET application so if you need any further information just leave a comment.
EDIT:
It is now running at least thanks to Julian and Marge, but when I run it using VS it has the default view, why isn't it showing when I run it through IIS? When running through IIS it just lists the files:
This error is because your website, in the IIS Server, does not have the Directory Browsing enabled and the default document (default page of the site ex: Default.aspx) configured.
Go to IIS Server IIS > Default Documents and check if the default page of your site is listed, if no, add the page.
Check the related link:
https://support.microsoft.com/en-us/kb/942062
Generally speaking, you do not need to access IIS manager at all to run your webpage on localhost. All what you need to do is right click on the project and then choose properties. In the Web tab you will find Servers section. Make sure the Project Url is something like http://localhost/myproj or simply http://localhost/ then hit Create Virtual Directory. Your webpage should be up by then, and you can access it either in debug mode, or simply by navigating your browser to the Project Url you have chosen.
When you add web application in IIS ex.
That your hostname should be to add in host file which is C:\Windows\System32\drivers\etc"\hosts
ex.
127.0.0.1 test.pln
I've recently been working with ASP.NET again and decided to create a small ASP.NET project in a subfolder on one of my websites. I'm using Visual Studio 2013 and created the project using the ASP.NET Web Forms Application template. After creating the project, I left everything at the default, verified that it would build locally, published it to a folder on my system and then copied the published files via FTP to the subfolder on my site. When I tried to bring it up in my browser, it failed with the code ERR_CONNECTION_RESET. This told me that the host was seeing something there, otherwise it would have gone to my site's main 404 page. Chrome also refused to load the other pages within the deployed template. I did set the folder as an application in IIS after getting another error about forms authentication but that didn't have any effect.
I was able to successfully re-deploy an old ASP.NET site created with .NET 4.0 in VS2010. I was also able to deploy and load a project created in VS2013 / ASP.NET 4.5.1 with the ASP.NET Empty Web Application template.
I finally finally get the Web Forms template to work by doing the following -
Created a basic Default.aspx page with no master page.
Created a basic web.config file (copied from another new empty
project)
Commented out the following lines in the Application_Start function of Global.asax
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterOpenAuth();
RouteConfig.RegisterRoutes(RouteTable.Routes);
At that point, the project ran on the host with no problem. I then restored the Default.aspx and Web.config files and the project again failed, even with the Global.asax lines still commented.
I also changed the SessionState mode to "Custom" as suggested in the web.config file and this made no difference.
My question at this point is this - Has anyone else deployed a .NET 4.5.1 Web Forms app designed from the VS2013 template to a shared hosting service and is there something that you have to do to get it to work?
I'm fairly satisfied at this point that I can use the empty web application template and build things from scratch but I'd like to know if anyone else has run into this and what they did.
Thanks.
ERR_CONNECTION_RESET sounds to me like you were having some kind of Internet connectivity troubles, or your server was having some sort of Internet connectivity trouble. If it's working fine now, probably nothing to worry about.
Has anyone else deployed a .NET 4.5.1 Web Forms app designed from the VS2013 template to a shared hosting service and is there something that you have to do to get it to work? Yes, lots of people have done that.
I'm writing an ASP.NET web service, in C#. Before yesterday if I wanted to debug it I would just press F5, and ASP.NET Development Server would start hosting my service. Breakpoints would be enabled and would work. Recently this functionality is gone. Now when I start debugging, Development Server is started but the old version of my web service is hosted, and breakpoints do not work. I get a warning that versions do not match.
It does not help if I rebuild everything, or change the assembly version, or even change the file name of the DLL. It does not help if I delete the whole temp folder %TEMP%\Temporary ASP.NET Files. Old web service will be pulled out from who knows where, and stored in temp folder again.
Major change before yesterday was that I had installed IIS. Web service that is installed there works as expected, but I need to debug it as well. I thought that the problem is that I installed the web service (with vdproj), so I uninstalled it, but this did not help either.
How to prevent the system from caching the old version of web service. Where is this old version stored anyway?
Check the Web settings on your ASP.NET project. To get back to using the ASP.NET Development Server for F5 debugging make sure the "Use Visual Studio Development Server" radio button is selected under the Server heading. I also specify a specific port so other projects in my solution can consistently reference it (in my case I'm dealing with a web service). There's a good chance that you will find the "User Local IIS Web server" radio button selected.
Hope that helps.
EDIT: The problem here is not about IIS, but about changing the target build output folder of web service. It must be bin\, or Development Server cannot find it. Rebuild did not help because it would change dll file in new folder, but old file would remain undisturbed in bin folder.