无法识别的属性“目标框架" [英] unrecognized attribute 'targetframework'

查看:30
本文介绍了无法识别的属性“目标框架"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
无法识别的属性targetFramework".注意属性名区分大小写

首先,让我说我知道这个问题已经在这个网站上被问过几次 - 但所有这些问题的答案都不能解决我的问题.

Firstly, let me say that I'm aware that this question has been asked a few times on this site - but the answers to all of these don't resolve my issue.

当我尝试在 IIS7 中添加新的托管处理程序时,我看到了以下问题:

I'm seeing the following issue when I try to add a new managed handler in IIS7:

无法识别的属性targetFramework".注意属性名区分大小写.

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

环境是安装了 IIS7 的 Windows Server Enterprise 2008 SP1.

The environment is Windows Server Enterprise 2008 SP1 with IIS7 installed.

我的应用程序正在使用 .NET 4.0..NET 框架是在 IIS 之后安装的:

My application is using .NET 4.0. The .NET framework was installed after IIS:

我已经尝试/检查了以下内容:

I've tried/checked the following:

  • 我的应用程序池正在使用 .NET 4.0(我安装了一个版本的 .NET 4.0,没有测试版等)
  • 使用aspnet_regiis.exe -iru"确保 .NET 4.0 已正确注册到 IIS.
  • 回收应用程序池,重启机器.
  • 完全卸载 .NET 4.0,然后重新安装.
  • 删除了 'targetFramework' 属性 - 这只会导致其他地方崩溃.

在我看来,IIS 似乎仍在以某种方式引用以前版本的 .NET,即使我在 IIS 中的应用程序池告诉我他们使用的是 .NET 4.0.

To me it looks like IIS is still referencing a previous version of .NET somehow, even though my app pools in IIS tell me they are using .NET 4.0.

我的网站加载正常,但由于这个问题,我无法设置自定义图像处理程序.

My website loads fine, but I can't setup my custom image handler due to this issue.

如果有任何建议,我将不胜感激.

I'd greatly appreciate any advice.

谢谢.

更新

这太疯狂了..我已经完全从头开始被环境重建了:

This is crazy.. I've completely rebuilt by environment from scratch:

  • 从 MSDN 下载不带 Hyper V SP1 的 Windows Server Enterprise".
  • 安装 .NET 4.0
  • 安装 ASP.NET MVC 3
  • 添加Web 服务器"角色 - 确保应用程序池使用 .NET 4.0
  • 部署我的项目

当我尝试添加自定义处理程序映射时,也会出现同样的错误.我要么做错事/完全愚蠢,要么在这个设置中 IIS7 存在一些问题.IIS 无法识别 .NET 4.0 中的targetFramework"属性,即使我的应用程序池设置为使用 .NET 4.0.

The same error occurs when I try to add a custom hanlder mapping. I'm either doing something incorrectly / completely stupid or there is some issue with IIS7 in this setup. IIS doesn't recognise the 'targetFramework' attribute from .NET 4.0, even though my app pool is set to use .NET 4.0.

如果我使用命令aspnet_regiis -lv",它会告诉我只有 .NET 4 注册到 IIS.

If I use the command 'aspnet_regiis -lv', it tells me that only .NET 4 is registered with IIS.

推荐答案

向 IIS 注册框架对我有用:

Registering the framework with IIS is what worked for me:

C:WINDOWSMicrosoft.NETFrameworkv4.0.30319>aspnet_regiis -i

这篇关于无法识别的属性“目标框架"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆