I have an IIS-hosted WCF service, and yesterday I found out there were 66,235 folders (!!!) created in a temp folder 5 levels under the "Temporary ASP.NET Files" directory (\234lkj\98734dc\assembly\tmp). Each one of those folders had exactly one of the dlls needed by the service, which only needs 6, so each dll was copied about 11,000 times on different folders. Does IIS copy them from the bin folder regardless of whether they change or not? Is this normal behaviour? Is there a configuration setting that will prevent IIS (or whatever process is doing it) from unnecessarily copying a dll?
The temp folder is used by .NET to JIT compile references from other services. .NET needs a place to create the files and then compiles this code to eventually work with the service. Now, why you are seeing so many files may have more to do with how the application pool that hosts the site is set up. If you look in the advanced settings for your application pool, look at how many worker processes are assigned. Each worker process can exist with its own memory, so this would require multiple folders being JITed if multiple service references abound. Also, check to make sure that process orphaning is not set to on. If so, your processes can leave behind the files, causing the build up that you see.
Related
I am working on an ASP.Net Core 3.1 API application that downloads files. It will be saving those files to a folder outside the website. I know there will be an issue of allowing the process to write to the target directly. I found this post that talks about setting things up for .Net Framework on IIS7 (IIS7 Permissions Overview - ApplicationPoolIdentity) but I am deploying on IIS 8.5 and I am not able to find the user "IIS AppPool\DefaultAppPool".
Q1: So what exactly is the "IIS AppPool" part? Normally I am used to that being either the machine name or the domain name, but it is clearly neather since it is to be found on all machines.
SOLVED!!!!! I HAVE created a unique app pool for the app, let's call it 'upload-system'. I was going to ask how to enter it into the "Select User or Groups" and thought I should test it without quotes real quick... it worked!!!! I still want to know the answer to Q1, but I got the main problem working!!!!
The reason you cannot find the DefaultApppool is that your application pool may no longer have this application pool. If you want to give write permissions to the folder, you should try IIS AppPool\Application pool name. For example, your application pool name is Test. What you should assign to the folder is IIS AppPool\Test.
Find the application pool where your deployed application is located, and then assign this user permission to the folder.
I am looking to move some .NET Core applications into production and with the old .NET framework you could update the compiled DLL's for the application's code at any point.
The next time the application pool recycled, you would get your new code - or you could recycle the app pool manually.
With .NET Core, it appears that the running application locks the DLL and it cannot be overwritten until either the process is closed through inactivity, or is ended via Task Manager (Window's server here).
Is the a preferred method to publish a new version without having to set a maintenance window for all the users? This is on a Windows 2012 R2 server running the .NET Core framework via IIS 8 and the App Pool having no managed code.
For ASP.NET Core hosted with Kestrel runs in separate process and IIS works like Reverse Proxy. So there is not way for DLL release unless you implement it you your application.
Set up a hosting environment for ASP.NET Core on Windows with IIS, and deploy to it section Deploy the application, item 4.
If you want to avoid downtime simply setup two websites on IIS with same set of settings, make an update on second website, put first down, and start second.
I think the simplest way is to copy all files into a fresh folder and changing the physical path of the web site.
For example, you have all web sites under C:\WebSites, you also have a subfolder for each web site such as C:\WebSites\MyWebSite and a subfolder for each version, such as C:\WebSites\MyWebSite\V01.00.
To deploy a new version V01.01, create a new subfolder C:\WebSites\MyWebSite\V01.01 copy all files to that folder and change the physical path of the web site.
You can easily change the physical path with PowerShell:
Import-Module WebAdministration
Set-ItemProperty -Path "IIS:\Sites\MyWebSite" -name "physicalPath" -value "C:\WebSites\MyWebSite\V01.01"
This is a form of "hot publishing". Additionally you can easily roll back to the previous version if something goes wrong.
Another alternative is to use symbolic links, for example C:\WebSites\MyWebSite may point to C:\WebSiteVersions\MyWebSite\V01.00. To deploy a new version, copy all files to C:\WebSiteVersions\MyWebSite\V01.01 then change the symbolic link so that C:\WebSites\MyWebSite points to C:\WebSiteVersions\MyWebSite\V01.01, and finally recycle the application pool. Click here to see code for doing that
There is also another option called "blue green deployment" strategy. This strategy requires configuring a single server web farm and two web sites. Please see this article for a complete description.
I have a MyComapny.Models project and a MyCompany.DataLayer project. I have about ten services: UserService, PurchaseOrderService, CustomerService, etc.. Each of the services has a reference to both .dlls. When I publish a service, it packages up the referenced .dlls and puts them in my server's IIS XService\bin\referencedDllNameHere.dll. That means that if I want to make a minor change to one of the .dll's, I have to re-publish all ten+ services (or copy the updated .dll in 10 places).
Is there a way to publish the service and have it look at a common location for the two referenced .dlls? This way, there is ONE single location where they would need to be updated. I could simply paste over them and viola. Any suggestions are much appreciated. Thanks.
If you wanted to reference shared copies I would use reflection to load/unload the .dlls at runtime inside your services. This would allow you to reference from a common location and you could change/updated the .dll files without having to rebuild your service code.
I have an .Net webapplication which connects to a reporting web service.
In my development studio, I just add an webreference, then specify the path where the reporting server is installed and reportservice2010.asmx is found and ready for use.
But i do not know how to deal with it, after my application is compiled.
When I would like to distribute it on lets say 100 different servers.
The path to reportservice2010.asmx may(and surely will) change.
Of course what will make my application corrupt.
Please help !
When you added the web reference, Visual Studio should also have added a new section to the application's configuration file. That section specifies the environment-specific details of the web reference.
If, for any given target environment, the target address of the web reference changes then you can simply change the URL in the application's configuration file.
I have a silverlight application which hosted in asp.net web site.
I store some information in .txt file isolated storage, in order to load it next time the application called.
Here I have a strange problem: sometimes the application doesn't find the file!
I checked what exactly happens, and discover that the isolated storage (I checked on Windows 7) composed of set of folders, their names seem as keys/guids.
when the application doesn't find the file, for some reason it goes to another key/guid folder, not to the folder the application saved the file on!
I read about it throughout the net, and understand that the key/guid folders created by microsoft according its security policy.
the code I used to create the isolated storage is:
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForSite();
I tried also
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()
-the same problem.
what can I do?
I'll be glad to detail more, if necessary.
thanks a lot!
I found the problem- the website which hosts the silverlight application create two domains- one with www and another without.
this was created the two isolated storages, and cause the confusion.