We have a Website and two services hosted in IIS7
as UAT/STG and LIVE
Since updating NHProf the staging site and UAT sites have died with the following error.
net4exception: System.InvalidOperationException: Could not write to output file 'c:\Windows\Temp\HibernatingRhinos.Profiler.Appender.NHibernate3Logger.dll' -- 'Access is denied. '
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileInternally(String fileName, List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String compilerVersion)
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String assemblyFileName)
net35exception: System.InvalidOperationException: Could not write to output file 'c:\Windows\Temp\HibernatingRhinos.Profiler.Appender.NHibernate3Logger.dll' -- 'Access is denied. '
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileInternally(String fileName, List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String compilerVersion)
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String assemblyFileName)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: net4exception: System.InvalidOperationException: Could not write to output file 'c:\Windows\Temp\HibernatingRhinos.Profiler.Appender.NHibernate3Logger.dll' -- 'Access is denied. '
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileInternally(String fileName, List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String compilerVersion)
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String assemblyFileName)
net35exception: System.InvalidOperationException: Could not write to output file 'c:\Windows\Temp\HibernatingRhinos.Profiler.Appender.NHibernate3Logger.dll' -- 'Access is denied. '
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileInternally(String fileName, List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String compilerVersion)
at HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(List`1 sources, HashSet`1 assemblies, HashSet`1 defineSymbols, String assemblyFileName)
In the temp folder there are some dll's
but they're all named randomly... bar the NHProf lib.
Any ideas on how to stop this?
Create manifest file (app.manifest) and change
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
to<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
. Now should be ok.Maniest code example :