Error path of site running on localhost - asp.net

I have a ASP.NET site running locally (localhost) on my Windows 7 computer. I have an error when loading one of the pages. The error is in an aspx.cs file and I can see how to fix it easy enough. But when I edit the source file nothing changes.
So I notice that on my machine the path to the file is C:\intetpub\wwwroot\folder\codefile.aspx.cs
But on the error message the path is e:\intetpub\wwwroot\User_Sites\folder\codefile.aspx.cs
I realize this must be a virtual directory used by the IIS (I assume) but cannot figure out why editing the code file on C: does not lead to it being loaded into the virtual directory when I run it.
I do not have a physical e: drive or User_Sites folder anywhere.
I realize this is probably a simple question but perhaps someone could point out a reference that explains this, or provide a simple explanation?

That means that the web server is using a version of the application that was built using the sources in e:... and not the version you are working on.
Try:
stopping the WWW publishing service
deleting the contents of C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
deleting the bin folder of your application
building the application
start the WWW publishing service.

Related

ASP.net Visual Studio 2019 project won't load because IIS Express cannot read configuration file on mapped network drive

I have an ASP.NET Web Application (.NET Framework) that was created in the default location of C:\Users\mcarr\source\repos\ It loads fine from this location.
I was asked by my manager to keep projects out on a mapped network drive. So I created the source and repos folders on the mapped drive and copied the entire project to the new location.
It won't load from here. I get an error message stating that the creation of the virtual directory https://localhost:XXXXX/ failed. Cannot read configuration file. You will need to manually create this virtual directory in IIS before you can open this project.
I have researched with no luck...
Cannot read configuration file due to insufficient permissions
Visual Studio - Cannot Read Configuration File
I did try the suggestion of removing the URL from IISUrl in the project file.
Thinking that it may be some other configuration file, I even created another new project in VS2019 and changed the location to the repos directory on the mapped drive from the Configure your new project window of VS2019, and saved the newly created project directly there. Even this new test project, created in place, gives the same error message.
Any ideas?
Full environmental disclosure:
VisualStudio 2019 Enterprise with Jetbrains Resharper installed.
64-bit Windows 10 Version 21H2 Build 19044.1826
Open Enterprise Server (OES) network. (Used to be known as Novell) (I suspect this is the root of the problem)
Turns out that OES and Windows don't play well together. I have several mapped drives available for me to store projects on. Some are on OES servers and others are on Windows servers. A help desk guy told me that when copying files from an OES drive to a Windows box he has to put them in C:\temp first, then move them from the temp folder to the desired folder. Windows doesn't trust files from an OES share.
So I moved my project to a mapped drive on a Windows box and the IIS Express error is gone.
I'm a programmer, not a network admin, and this was new to me.
But, problem solved.

Error code 550 when publishing .NET Core 3.1 app through FTP

I have a .NET Core 3.1 app (api) that i'm publishing online and I'm using the publish method FTP in Visual Studio.
It works perfectly but when I try to publish again after coding, I always get these errors:
Publishing folder /...
Unable to add 'AutoMapper.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
Unable to add 'projectname.API.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
Unable to add 'projectname.Domain.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
...
This goes on for quite some time on all the dll's in my project. The only way I can publish after working, is full resetting my PC, remove all bin and obj folders in my projects that have to get published, open VS and publish before doing anything else.
I suspect this has to do with VS still using the dll's somewhere/somehow while i'm trying to publish.
I have tried locating processes in task manager but haven't seen anything unusual/problematic that could cause this.
Any help regarding this would be greatly appreciated, because I like to update my API for every route I write to test on the deployed version aswell, but it's quite the hassle this way...
Thanks!
I don't think it's your pc. Error 550 is an FTP error. What I think is happening here is that when you publish your website via FTP and open your website in your browser what you actually do is run your application on your server.
When your application is running you can not modify the DLLs that are in use.
So why restarting your pc will fix the problem? It is because these hosting providers have a configuration that if no one requests a website for a while then kill the application. it is because of saving memory and cpu.
So when you restart your pc and delete bin and obj folders and rebuild your project that takes time and because in the meantime there is no request sent to your website your application is killed and now you can update your website with FTP again.
To test this scenario simply close your browsers and do not open your website for a while like half an hour and then try to update your website via FTP.
Or you can restart your PC and delete bin and obj folders but before pushing your files with FTP open your site in a browser. This must run your application and cause the 550 error again.

ASP.NET failing to call a dll

My question may have already been asked but any of the answers match my case.
I need to do a website (ASP.NET MVC 4) with some features of a software. I have finished to developed my website and wanted to test it in a test environment (Windows server 2008 - 64bits).
It works perfectly fine with my dev computer(windows 7 - 64bits). But after I deployed it on IIS, one of my features doesn't work.
This feature is a bit particular. It need a 32 bits COM written in VB6 (this dll can't be change) that call an other dll. When I test the website deployed on IIS, the first ddl is called fine but the 2nd seemed to be not called at all.
This dll are in the installed file of the software. I have the same version of on both computer.
I authorize my app pool to use 32bits application. I tried to give some access to my dll (the COM and interop) like IUSR, IIS_IUSRS. But nothing seems to work.
I have checked both of my dll are registered properly.
I'm a bit lost. Can someone help me ?
PS: Sorry for my English, I can speak but I'm really weak with syntax.
Some suggestion here:
You need to figure out which managed dll, native dll and lib files are referenced by your application (directly or indirectly).
For managed dll, make sure they are in the web's bin folder.
For native dll and .lib files, check out whether those .dll and .lib files are in the PATH. If not, you can either copy them to there; or, you can put them into a folder and add that folder into the PATH. Then restart VS and IIS (command "iisreset") to make sure the setting is picked up.
By the way, putting all of the files in the web's bin folder won't help. The reason is CLR copies the files into a temporary folder under framework directory and run the web there, but CLR only copies away managed dll (not the native ones), so you still get "module not found" error.
I have reproduced this error using the following sample solution
Web1 references a managed c++ project say "MCpp1.dll". The project further references two unmanaged c++ projects with the output say "Lib1.lib" and "Lib2.lib"
If I copy all of those files into web's bin folder, I get the exception of "module not found error".
I create a folder say "C:\Lib" and copy "Lib1.lib" and "Lib2.lib" into it and add this folder into PATH. I restart VS, and also run "IISReset" since I have a IIS web
Open VS and request a page and it works now
I have also contacted the CLR/Fusion team for suggestion of how to get the related module name when this exception happens, which should be very helpful to make diagnosis.
Hope this helps ,
GODFATHER

Access Denied in Bin Folder for ASP.NET Site

Using Visual Studio 2008, I have published my ASP.NET website to my local disk in preparation for deploying to our test server. Using an RDP session, I've connected to the test server running Windows Server 2003, making my local disk available as a resource to the RDP session. When I attempt to copy the files from my local disk to the server, everything copies without issue except for the DLLs in the bin folder. Every time I try to copy a DLL I get the following error: "Cannot copy [filename]: Access is denied. Make sure the disk is not full or write-protected and that the file is not currently in use." I am able to copy any file outside the bin folder and any file except DLLs in the bin folder (such as .compiled files).
It's been a while since I've worked with IIS and ASP.NET so I'm admittedly a little rusty but I've tried everything I know of to fix the issue. I checked the obvious, there's 3+ GB free on the disk, and the file is not write-protected.
I've also tried everything I can think of to make sure the files are not in use. I tried recycling the application pool, restarting the default web site, both restarting IIS and stopping/starting IIS using the GUI, ending the w3wp.exe process in task manager, Shift-deleting the file, deleting from the command prompt, having two other users attempt to delete the files using their login credentials, and restarting the server twice. Nothing at all has worked so far and I'm at my wit's end.
Hoping someone has any suggestions on what else I can try to fix this, any help would be much appreciated.
Try stopping IIS from the command prompt, then restart and after restarting confirming that IIS is still stopped.
After confirmation of the above, zip the files, copy the zipped file over to your server and unzip. Run AV on the files, and you may need to "unlock" the zip.

Location of symbols for WCF remote debugging

This is more a 'why does this work this way' than a 'how do I make this work' sort of question.
I have a WCF web service I am debugging remotely. It is deployed to a staging server where the VS 2010 remote debugger is installed and running as a Windows service. The permissions are correct, I can attach to processes without any problem. The issue I ran into is I couldn't consistently get the symbols to load.
I have the WCF service deployed to C:\Webs\MyService, with assorted DLLs in C:\Webs\MyService\bin. It is set up as a separate site with its own app pool. What I found is even if I had the necessary .pdb file in the bin folder, Visual Studio wouldn't load any symbols when I attached to the w3wp.exe process from my local machine. What was happening is when IIS started and the worker process was spawned, my service DLL would get copied deep under the temp ASP.NET files directory, into something like C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\19f82539\e55fff8f\assembly\dl3\2926a261\f625d158_f62ecd01. I found that if I manually copied the .pdb file to this folder, then symbols would be loaded and I could do the debugging.
I'm wondering why the heck it works that way, and how I can avoid having to manually copy the symbol file to this other directory. What's worse is if I had to make changes and redeploy, the worker process wouldn't recognize them. I had to restart IIS which caused a different temp directory to be created, requiring me to copy the .pdb again.
I have a similar problem, with web applications. Apparently Microsoft are aware of this: http://go4answers.webhost4life.com/Example/remote-debugging-symbols-not-loaded-207525.aspx
Hopefully, they will release a fix soon.
There is also a suggestion by BrianR on a related question, Why are no Symbols loaded when remote debugging?, saying to create a folder with the debug files and on the remote server to point the environment variable _NT_SYMBOL_PATH to it.

Resources