"Cannot read configuration file" when running ASP.NET app - asp.net

I recently decided to move all my VS projects to a dropbox folder so i don't have to carry my USB drive around all the time. I just copied all contents into the dropbox folder but when I run one of my ASP.NET projects, I get an HTTP error 500.19:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\I:\Documents\Schule\Praktikum\IHK-Projekt\WerIstWo\WerIstWo\web.config
I think it still looks for the config file in my usb drive, which I assigned the drive letter I:. How do I change this so it will my local the Dropbox directory with drive letter C:? What happens if I install Dropbox on another machine on D: drive? Will I get the same error?
Thanks for any help!

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.

Deploying ASP.NET application to more than one live server using BAT file

Currently I'm deploying an ASP.NET application to 4 live servers that are load balanced manually by zipping and dropping the files to the servers. I would like to know how can I write a BAT file and run from a command prompt to install the application to all the 4 servers. Any help or reference would be appreciated.
Here are the steps if only files must to be updated (no the database)
Create a bat file and do that steps, after you have copy the updated files on some directory.
Make a file called app_offline.htm on your root of your web site, and the site will go offline.
Overwrite the new files over the site.
Rename or delete the app_offline.html file
Here is the command to make the copy copy all files and folders from one drive to another drive using DOS (command prompt)

Error path of site running on localhost

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.

Execute ClickOnce application located on share, through HTTP?

i have a ClickOnce application (online only) which is deployed on a network share. People can run the application by creating a shortcut to i:\ApplicationDirectory\ApplicationName.application
where i is the letter of the drive of the networkshare.
I want to start the application over HTTP. For this, I need the .Application file to be accessible through my webserver. However I am unable to select the ApplicationDirectory as a virtual directory for IIS. I tried copying the .Application file to a virtual IIS path, but this makes the deployment corrupt (i also updated application_files reference in the .Application file). Is there a(nother) way to start a ClickOnce application, deployed on a network share, over HTTP?
First find your ClickonceKey.pfx, in other words the key used to sign assemblies.
Then find mage.exe, the utility for signing manifests that's part of the .NET Framework SDK. For VS2005, it can be found at %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin.
Then create a batch file to execute mage.exe.
Then copy the contents of the network share deployment folder to a new virtual directory on the web server.
Finally, run the batch file.
The batch file should look something like this:
mage.exe
-update >>path to your application manifest in the virtual directory<<
-providerurl >>location of application manifest virtual directory<<
-certfile Clickoncekey.pfx -password >>your password<<

Resources