webForumDet fria alternativet

Ej rättighet att läsa registret

.NET

2 svar · 237 visningar · startad av NETwork

Medlem sedan juni 20011 732 inlägg
Frågan#1

Har problem att läsa i registret på en server från en webb. Får felmeddelandet:

Exception Details: System.UnauthorizedAccessException: Access to the registry key HKEY_LOCAL_MACHINE\Software\Comit\Intranet is denied.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Jag har följt anvisningarna men det hjälper inte. Har även ändrat i machine.config från machine-account till system-account (vilket ska ge fler rättigheter om jag förstått saken rätt), men det hjälpte inte. Kan ju nämna att jag bara ska läsa i registret, inte skriva. Detta har fungerat förut utan krångel men nu är det alltså stopp. Alla tips och förslag mottages tacksamt!

Medlem sedan juni 20022 599 inlägg
#2

Det låter ju lite udda att inte ens läsrättigheter finns, men ..
Har du kollat med regdt32 hur rättigheterna ser ut på den
nyckel du vill komma åt?

Medlem sedan juni 20011 732 inlägg
#3

Jag har löst det... jag "lånade" en klass som vi använder till flera olika projekt och i denna försökte den även skriva i registret vilket jag hade missat. Tack ändå!

266 ms totalt · 4 externa anrop · v20260731065814-full.6fe65c25
128 ms — deklarationer (db)
0 ms — hämta statistik (cache)
134 ms — hämta tråd, inlägg och bilagor (db)
128 ms — ändringar (db)