I know that with dynamic compilation under an ASP.NET Web Site, code behind files get compiled into Assemblies. Where do these DLL's get stored when running IIS Express? Is it in memory only? I don't see them in the bin folder, or in the temp directory (C:\Windows\Microsoft.NET\Framework[64]\v4.0.30319). Typically I generate them when precompiling them whenever I publish. In this case, though, I don't see them.

Am I missing something?

Thanks.

UPDATE:

I did see dll's under C:\Users\Administrator\AppData\Local\Temp\Temporary ASP.NET Files\root

So I'm thinking it stores them there? This is Visual Studio 2012, .NET 4.5.

有帮助吗?

解决方案

Please refer to this: http://msdn.microsoft.com/en-us/library/e22s60h9%28v=vs.85%29.aspx

It really should be in your Bin folder.

This is additional info for framework 4.5: http://msdn.microsoft.com/en-us/library/hh475319.aspx

其他提示

It's quite likely not your bin folder. Everything gets copied into a set of temp folders.

I wrote a method for just this problem -

private string[] GetAssembly(string[] assemblyNames)
{
    string [] locations = new string[assemblyNames.Length];

    for (int loop = 0; loop <= assemblyNames.Length - 1; loop++)       
    {
         locations[loop] = AppDomain.CurrentDomain.GetAssemblies()
           .Where(a => !a.IsDynamic && a.ManifestModule.Name == assemblyNames[loop])
           .Select(a => a.Location)
           .FirstOrDefault();
    }
    return locations;
}

See this post I wrote on the topic - http://nodogmablog.bryanhogan.net/2015/05/finding-the-location-of-a-running-assembly-in-net/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top