无法加载文件或程序集“AjaxControlToolkit”升级到.net 4.0后

发布于 2024-08-14 17:00:33 字数 733 浏览 10 评论 0原文

我有一个 Web 应用程序,正在尝试升级到 .net 4.0。

我获取了该应用程序并通过 Visual Studio 2010 Beta 2 打开它,并选择了该应用程序的升级路径。该应用程序使用 AjaxControlToolkit。现在升级已完成,当我尝试访问页面时,我收到错误消息:“无法加载文件或程序集“AjaxControlToolkit”或其依赖项之一。访问被拒绝。”

我已经尝试过:

  • 重新启动计算机
  • 清理解决方案
  • 删除临时 ASP.Net 文件中的所有文件
  • 放松 Bin 目录、临时 ASP.Net 文件目录的权限(添加具有完全控制权的每个人)
  • 的引用

删除并读取对 AjaxControlToolkit DLL AjackControlToolkit 的相关 web.config 条目是:

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
  <controls>
    <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
  </controls>
</pages>

关于这里发生的情况/如何解决此问题的任何想法?

I have a web application that I am attempting to upgrade to .net 4.0.

I took the application and opened it via Visual Studio 2010 Beta 2 and selected the upgrade path for that application. The application uses the AjaxControlToolkit. Now that the upgrade is complete when I attempt to access a page I get the error message: "Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. Access is denied."

I've tried:

  • Restarting my machine
  • Clean Solution
  • Removing all files in Temporary ASP.Net Files
  • Relaxing permsissions (added Everyone with Full Control) on the Bin directory, the Temporary ASP.Net Files directory
  • Removing and readding the reference to the AjaxControlToolkit DLL

The related web.config entries for the AjackControlToolkit are:

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
  <controls>
    <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
  </controls>
</pages>

Any ideas as to what is occuring here/how I can fix this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

凑诗 2024-08-21 17:00:33

我遇到了类似的问题,但可以通过为我的模拟身份授予“临时 ASP.NET 文件”文件夹的完全权限来解决。

I had a similar problem but was able to resolve by granting full rights to the "Temporary ASP.NET Files" folder for my impersonation identity.

一身仙ぐ女味 2024-08-21 17:00:33

我意识到已经有一个被接受的答案,但对于通过搜索错误代码进入此页面的其他人......

请检查您尝试模拟的用户的权限。

在我的情况下,我只在我的开发计算机上收到错误,而不是在我们的临时或部署服务器上收到错误。 (虽然我通过从开发环境中的配置中删除“身份”节点并在构建后添加该行来解决这个问题,所以这对除了我之外的任何人来说都不是问题。

在我的环境中,我们有一个特定的我们所有的网络应用程序在运行时都会模拟用户帐户,但没有明确设置其帐户权限。当我在我的开发计算机上添加该用户时,这个问题完全消失了。我知道,但它“对我有用”,并且危害最小,因为该用户帐户无论如何都被锁定在我们的“真实”服务器上..)

I realize there's already an accepted answer, but for anyone else coming to this page via a search on the error code....

Review the permissions of the user that you're trying to impersonate.

In my situation, I was only getting the error on my development machine, rather then on our staging or deployment servers. (For while I got around this by removing the 'identity' node from config in my dev environment and just adding the line in post-build so it wasn't a problem for anyone other than me..

In my environment we have a specific user that all our web apps impersonate when running. I had created the user account, but hadn't explicitly set its account permissions. When I added the user as an Administrator on my dev machine, this problem went away completely. (Not ideal, I know, but it "works for me", and has minimal harm since that user account is locked down on our 'real' servers anyways..)

峩卟喜欢 2024-08-21 17:00:33

我认为关于 C:\Windows\Microsoft.NET\Framework64\v4.0.21006\Temporary ASP.NET Files[projectName] 中的临时文件的帖子是正确的。

我通过编辑权限来解决该问题,以确保 ASP 模拟用户(在 IIS 的安全部分中找到,作为应用程序在允许匿名访问时应使用的匿名用户)对目录具有适当的安全性。

解决了问题...访问被拒绝通常表示权限问题。

I think the post about the Temp files in C:\Windows\Microsoft.NET\Framework64\v4.0.21006\Temporary ASP.NET Files[projectName] was on the right track.

I solved the problem by editing permissions to be sure that the ASP Impersonating user (found in the security section of IIS as the Anonymous user that the app should use when allowing anonymous access) had the proper security to the directory.

Solved the problem... Access Denied ussually points to a permissions issue.

靖瑶 2024-08-21 17:00:33

当我在新的 Windows Server 2008 计算机上重新安装 ASP.NET 应用程序时,我收到此错误消息(尽管是另一个 dll 文件)。我花了几个小时寻找解决方案,尝试了一切,但没有成功。直到我停用迈克菲防病毒软件。当我这样做时,一切都像魅力一样发挥作用。

I got this error message (although another dll file) when I reinstalled my ASP.NET application on a new Windows Server 2008 machine. I searched for a solution to this for hours, trying absolutely everything, but to no avail. Until I deactivated McAfee antivirus. When I did, everything worked like a charm.

懒的傷心 2024-08-21 17:00:33

不是 100% 确定为什么会这样,但在适当的临时 ASP.Net 文件目录(位于:C:\Windows\Microsoft.NET\Framework64\v4.0.21006\Temporary ASP.NET Files[projectName])中,我手动复制了AjaxControlToolkit.dll。

然后,我看到了丢失的其他 DLL,但在手动将它们复制到此位置后,我也能够解决这些问题。似乎不是最好的答案,但它最终对我有用。

Not 100% sure why this worked, but in the appropriate Temporary ASP.Net Files directory (located at: C:\Windows\Microsoft.NET\Framework64\v4.0.21006\Temporary ASP.NET Files[projectName]) I manually coppied the AjaxControlToolkit.dll.

I was then presented with additional DLLs that were missing, but upon manually copying them to this location also I was able to resolve these issues. Doesn't seem like the best answer, but it ended up working for me.

清风无影 2024-08-21 17:00:33

我尝试向我的模拟用户授予对 Temporary ASP.NET Files 文件夹的完全权限,但这不起作用。我记得过去当我遇到这个错误时它就成功了。

我知道问题发布者尝试过这个,但当我在 Visual Studio 中删除/添加 AjaxToolKit 时,它对我有用。我建议先尝试他所做的一切。我希望这对某人有帮助。

I tried giving my impersonated user full rights to the Temporary ASP.NET Files folder, but that didn't work. I remember in the past when I got this error that it did the trick.

I know the question poster tried this but it worked for me when I removed/added the AjaxToolKit in visual studio. I suggest trying everything he has done first. I hope this helps someone.

古镇旧梦 2024-08-21 17:00:33

你可以试试这个:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ 。只需清理该文件夹内的所有文件夹和文件并编译您的应用程序即可。快乐编码!

You can try this:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ . Just clean up all the folders and files from inside this folder and compile ur application. Happy coding!

指尖上的星空 2024-08-21 17:00:33

奇怪的错误。 web.config 文件中是否有任何内容指向 AjaxControlToolkit,并提供了公钥令牌或其他程序集规范?我就遇到过这种情况,值发生了变化,或者我从 GAC 中的引用更改为本地引用......

HTH。

Odd error. Is anything in your web.config file pointing to the AjaxControlToolkit with a public key token or other assembly specifications provided? That has happened to me, where a value changed or I changed from a reference in the GAC to a local reference...

HTH.

り繁华旳梦境 2024-08-21 17:00:33

我面临着同样的问题。经过大量研究后,我发现我在配置文件中使用了模拟。我必须将模拟 ID 更改为服务器本地的其他用户,它立即解决了问题。

I was facing the same issue. After a lot of research I found out that I was using impersonation in the config file. I had to change the impersonation ID to a different user that was local to the server and it resolved the issue immediately.

喜你已久 2024-08-21 17:00:33

检查 DLL 的属性。如果它在某处指出“此文件来自另一台计算机”,请单击复选框并“应用”,以解除 Windows 施加的限制。

Inspect the DLL's properties. If it states somewhere that "this file came from another computer", click the checkbox and "apply", to lift restrictions Windows has put in place.

小嗲 2024-08-21 17:00:33

请记住还要使用上下文菜单 [右键单击] 通过“以管理员身份运行”打开“Visual Studio”。

Remember to also open "Visual Studio" with "Run as administrator" using context-menu [right-click].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文