asp.net website deployment in IIS - asp.net

I have a very simple website which displays Hello World. I tried to deploy this project on the server. These are the steps I followed:
Copy the folder of the project to inetpub/wwwroot folder.
In IIS management, created a website. Gave the path of the website from step 1.
Gave the application pool as .NET 3.5
After doing the above, while browsing the page, I received the error- Type not found in web.config.

Check to see if you can browse a simple image there. that is, copy a jpg to the root of your web site and try to open it.
paste your web.config, that would be a help.
(app pool is set from advanced options in inetmgr program)

Add all website(or application.exe) files to the IIS Virtual Directory instead of wwwrootfolder. (IIS virutal directory is created by you while configuring IIS server)
Or
New Website
Under Locations Click on "Browse"
Click on "Local IIS" and then select the "IIS Virtual Directory"(IIS vitual Directory which is directory created by the user while configuring IIS server)
Open manually using Explorer drag and
add all you files to the "solution explorer"
then "Yes to all"

Related

Problem with IIS for creating file on Servers Folder

I have an AspNet App (Blazor) running on IIS server.
I would like to create a txt file on the server, but it doesn't work.
I changed the AppPool identity to a domain user accound and the directories in E: have full permissions for this account.
It works in VisualStudio IIS Express, but not in IIS.
Anyone here who can help me? A permission problem`?
C# Code for creating txt file:
File.WriteAllText(#"E:\Publish\Export\Test.txt", "Hello World");
If you want to save to a specific path, use MapPath (or Server.MapPath) to get the physical path corresponding to the application. Because by default the web server (IIS or local development server) will save to its working directory.
Also you need to make sure the account running IIS has read/write permissions to the directory you need to write to. If you're looking for user accounts, go to "Advanced Settings" under Application Pools and check what's set for "Identity".

Install asp.net mvc application on windows server

I have following problem:
there is windows server 2008 r2
it has iis 7.5 installed
I moved my application there (it is asp.net mvc 5 application), installed .net 4.5 framework on the server
ran following command in cmd
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
tried also %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir
but still it throws exception:
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
I enabled directory browsing and only thing that it can make is browse through folders. But it is web application and not file directory to browse.
So can anyone tell me what am I missing?
IIS configuration:
UPDATE 1
IUSR and IIS_IUSRS both have full control
I also tried adding Everyone with full control on the folder where my application is, but still same
make sure that the MVC Dll's are included in the build output of your project.
Also try adding this code to the system.webserver part of your web.config
<modules runAllManagedModulesForAllRequests="true">
https://www.iis.net/configreference/system.webserver/modules
<modules runAllManagedModulesForAllRequests="true" /> Meaning
If you are trying to test your site by launching http://yourdomain.com/ then it will display all files like you are "Browsing the Directory", you have to add a default document - this is the your main or landing page on your web application settings.
On IIS Manager, click your site, on the right pane, under IIS, click Default Document and set the page you want to show first.
"403 - Forbidden: Access is denied" means the IIS doesn't have the rights to access the resources in your application folder. It is usually a problem with the user the IIS uses to access the resources.
Just as a test: give "everyone" the full rights to the directory where your application is located. If this works, remove "everyone" and give the user IIS_IUSRS the rights to read the resources on the directory (maybe this user needs rights to write in the App_Data folder).
go to published folder of your application and give edit update access to iis user to that folder then it will work,
right click on folder
click properties and then click on security and then full control to iis user.

Run Web Application in Virtual Directory

I am trying to run my web application for test purposes in a virtual directory.
I have done this steps from this MS Site
In Visual Studio, open an existing Web application project, or create a new one.
In the Project menu, click Properties, and then click Web.
Click Use Local IIS Web server.
Enter a URL for the project, and then click Create Virtual Directory.
But after this configuration I get a HTTP-Error 500.19 - Internal Server Error
Details: There are duplicate entries in the web.config File
But the web.config file hasn't changed. Without the Virtual Directory the site is starting up as expected.
any ideas?

Deploy asp.net on IIS 8

I'm trying to deploy a asp.net site on iis 8 but i'm getting an error.
Site is working in visual studio, deployment is done without error using a custom profile with file system as publish method. (Here is actually my first question, should I use file system?)
Build->publish site->(Custom profile, file system, release)
Well, the site is added to selected folder which I've set up in IIS. I host several php pages from this folder whithout problem. But when I try to url forward to the new site I get this error: Given URL returns 500
I'm using IIS8, .tk adress through a dlinkddns.com adress
Any ideas?
Edit: added picture
What should I choose here if i'm hosting the page on the same computer? (I tried File system for now)
The error I get when I'm opening default.aspx
To deploy a website into IIS8 from Visual Studio, use 'File System' instead of 'Web Deploy', and put in the directory of where you want to publish your site.
Right-click your site name on your IIS 8 manager, select 'Add Application', and select the folder where you published your website in your physical path.
Click on the application under the website, then click browse, and you should view the website on your browser.
You can look at my question on how to create new website under the title, 'New website not showing default page in IIS 8.5'.

publishing website to the server

sir,
I have copied the asp.net website in to www root of server from my local pc.then created a website in iis of server.Then publish the website from my local host to the server iis http path .But when browse the website is not displaying.
In my local host I could run the project in visual studio.But after copying it to server wwwroot or(E:)I can not run the project.
This message is showing " can not be opened because its project type is not supported by this version of application"
How can I solve this
Thanks in advance
You must have convert your web site to application.
GO to iis-> Click on Site Folder and Expend it -> Select your website folder-> right click on it -> and Choose convert to Application and provide the further information.
That`s it.

Resources