asp.net website working on localhost but not on IIS - c#

I have built an asp.net website using visual studio 2012. My website contains various webforms(aspx). The purpose of my website is to monitor few processes on different machines on my network, i am gathering all the required information in code behind files (aspx.cs) using System.Management Class.
The website is working fine on visual studio development server, but when create a virtual directory on my IIS, I didn't get any errors but i am unable to fetch the information of the machines on my network. The information i am fetching include the couple of processes and their start time, The machine name, machine uptime.

When you are running the process in visual studio in debug, it's running under your username. Whereas when running on IIS, it's running as AppPoolIdentity. Check to see if the user that app pool is using has proper permissions to query processes on those machines.

go to application pool, and set your application pool to use local system account

You need to verify IIS_IUSRS & IUSR permissions for your site & other resources.
read more

Related

IIS - Access denied to directories and files on the novell network

I'm trying, through the action of a button on my website, to open a file that is on my company's network. Running the application only through visual studio, the file opens without problems. But when I register it in IIS, this problem happens. Through IIS I can't access the file, this message appears, as shown below:
Open file print
System.ComponentModel.Win32Exception: 'The specified network password is not correct'
For the network drives to be visible to me on my computer, every time I turn on the computer, I must enter the network username and password novel: Client for Open Enterprise Server 2 SP4 (IR7a). After login, the network drives appear. In one of these units is where I want to access a file through my website.
I believe the problem is in the configuration of IIS.
I configured authentication in IIS to be anonymous. I don't know how to configure it differently.
Would anyone know how to solve this problem?
Thank you very much in advance.
An addendum:
These are the mapped drives. I want to access the file of one of them through IIS:
Mapped drives
Addendum 2:
I found that I can't access local documents through IIS either. I can see the error through debug, with VS configuration in IIS Local. If I configure in visual studio for it to run the application in IIS Local, the document access problem occurs. I can't open the files through the button on my website.
As shown in the picture in the link: IIS configuration
When I open IIS, and I click on the page link, as shown:
Internet Information Service Manager - IIS, access problem occurs.
If I'm running Visual Studio with IIS Local configured, I can debug and see the problem.
If I run Visual Studio in IIS Express, I can access and open the files through the click of the button on my website, normally.
I just don't want to have to do this every time I need to run my site.
I want my site to work without needing to run visual studio.

MVC Authentication not working in IIS (works in IIS Express)

I have created an MVC project with individual authentication and am using the default template. When I launch the application from within visual studios (IIS express) I am able to view all the public pages, register an account, and login. Everything works great.
However, When I publish the project and host it on a full IIS server (on Windows Server 2016) I can view all the public pages, but registering or trying to sign in yields the following generic error:
I am using the LocalDb for the project and I noticed that the windows Identity on the deployed applicaiotn is "NT AUTHORITY\SYSTEM" while the IIS Express application's is USER-DESKTOP\User. Is this error being caused by a permissions issue and if so how do you fix this?
Also, is it bad to use localDB for a deployed project? There will only be two users using the application and they are both trusted.
It is totally not good idea to use localDB for a deployed project,
it is meant for developer testing only.
when you start debugging in vs the localDB is started.
its better if you use SQL Express
https://go.microsoft.com/fwlink/?linkid=866658
Try to set your site application pool identity to the local system by following the below steps:
1)Open iis manager
2)Go to the application pool and select your application pool name.
3)Click on the advance setting.
4)There is a "Process Model" option, under which there is an "Identity" option. This is by default the application pool identity. Change it to Local System, and you're done.
Set “Load User Profile” to True.

Deploying Windows Application(C#) using visual studio 2008

I am stuck while deploying my windows application (C#) in Visual Studio 2008. I am using setup wizard project to create the msi/exe file. This setup files I need to copy to the UAT server, run the setup and then use the application.
The main issue here is, I have created this application on my local machine and then installing it on UAT by taking remote of UAT server. This works properly. But when my colleague is running same application from his local machine by taking remote of UAT server, the application crashes.
Since the application working with my login, there seems to be no problem with the code.We are using our own windows login credentials for taking remote of UAT server.
Below is the error screenshot:
Please suggest what can be the possible reasons for the same application crashing with other user's id.
Thanks in advance.
0xe053534f is a StackOverflowException. You need to check if your setup script logic is resulting in any such stack overflow

run my Asp.Net Web application on another machine

How can I run my application on another machine, my team member wants to view the webpage in his computer. He doesn’t want to install visual studio but just wants to see the webpage in the browser.
I am using a Mac book
Publish it to a web server, or have him install IIS on his machine and set it up.. wait. That would be publishing to a web server.
In short, an ASP.NET website needs a web server to run. Usually it's IIS, but if you have Visual Studio, it uses the built-in Cassini web server. Either way, you need to have it in a web server of some kind. You can't just run it as a stand-alone program.
I haven't' done this, but I think you COULD have it running in your computer in Visual Studio and still have him see it. If you run it, you'll see that the address is in the format:
http://localhost/:[some port number]/YourWebAppName
If you have it running in Visual Studio on YOUR machine, your team member MAY be able to access it by changing "localhost" to your PC name. It's worth a shot.
Otherwise, here are a bunch of links to how to publish your site, in case you're not sure.
http://www.google.com/search?q=publishing+asp.net+web+sites&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Create a new virtual directory in IIS
Set the directory root to your project root folder.
allow anonymous access.
Your team member can then access it at http://yourmachinename/virtualdirectoryname
This looks like a good job for IIS express http://learn.iis.net/page.aspx/868/iis-express-overview/
For the majority of things, it's functionally equivilent to using regular IIS 7.5, with the exception that it's easier to start new websites with this. You simply use the command line to start IIS Express, point it to your physical path, set the CLR version, and the port, done!
http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
There's some instructions for how to do that.

Install WinForms application without admin rights

I develop a Windows Forms application using VS 2008. Application will be deployed in Corporate Environment: a network (VPN, LAN) is in several cities, many PC clients Windows XP; and there is a only Server Win2003, with several WCF Services, Windows Service, shared folders, and Database that use the WinForms app. Network is WORKGROUP, not domain.
The users in PC Clients has NOT admin rights. Only can install applications the only admin.
It is required automatized&easy way to install "desattended" the WinForms application for all users. I want get way to easy installations in PC Clients.
We don't want use ClickOnce. NOT use click once. Now, I have MSI (setup.exe) of WinForms App.
If if required another program, source code, scripting, etc, any sample code ??
any suggestions for my architecture network ??
Use XCOPY Deployment for more details.
Use InnoSetup and install the application to %LOCALAPPDATA%\MyApp, which is denoted as {localappdata}\MyApp in an ISS file.
Make sure your application uses Registry keys in HKEY_CURRENT_USER only. You can set these up using Root: HKLM
Set PrivilegesRequired to lowest.

Categories