简体   繁体   English

MVC 4应用程序无法在Windows 10上正常运行吗?

[英]MVC 4 app is not working properly on Windows 10?

My laptop was switched from Windows 7 to Windows 10 and Im doing MVC 4 development on it with VS 2012 Profesional. 我的笔记本电脑从Windows 7切换到Windows 10,我使用VS 2012 Professional在其上进行MVC 4开发。 The problem is the after reinstallation the application in not stable on local machine. 问题是重新安装后,应用程序在本地计算机上不稳定。 The problem are: 问题是:

Behavior 1) while opening project in VS 2012 profesional error apears: 行为1)在VS 2012专业错误提示中打开项目时:

ASP.NET 4.0has been not registred on the Web server. ASP.NET 4.0尚未在Web服务器上注册。 You need to manuallyconfigure your Web Server for ASP.NET 4.0 in order to your site work correctly 您需要为ASP.NET 4.0手动配置Web服务器,以便站点正常工作

I tried aspnet_regiis -i but it gives 我试过aspnet_regiis -i但它给

C:\\WINDOWS\\system32>aspnet_regiis -i Microsoft (R) ASP.NET RegIIS w wersji 4.0.30319.0 Administracyjny program narzędziowy do instalowania i odinstalowywania platformy ASP.NET na komputerze lokalnym. C:\\ WINDOWS \\ system32> aspnet_regiis -i Microsoft(R)ASP.NET RegIIS,版本为4.0.30319.0的管理程序在Instalowania中进行安装,并在ASP.NET平台上运行。 Copyright (C) Microsoft Corporation. 版权所有(C)Microsoft Corporation。 Wszelkie prawa zastrzeżone. Wszelkie prawazastrzeżone。 Rozpoczęto instalowanie platformy ASP.NET (4.0.30319.0). Rozpoczęto安装了ASP.NET平台(4.0.30319.0)。 Ta opcja jest nieobsługiwana w tej wersji systemu operacyjnego. 您可以在nieobsługiwana上进行操作。 Administratorzy powinni zainstalować/odinstalować program ASP.NET 4.5 z usługami IIS 8, używając okna dialogowego Włącz lub wyłącz funkcje systemu Windows, narzędzia do zarządzania Menedżer serwera albo narzędzia wiersza polecenia dism.exe. Administratorzy powinnizainstalować/odinstalować程序ASP.NET 4.5使用IIS 8,可以在Windows上运行Windows,并且可以在Windows上运行。 Aby uzyskać więcej szczegółowych informacji, zobacz http://go.microsoft.com/fwlink/?LinkID=216771 . 阿比(Abyuzyskaćwięcejszczegółowych),zobacz http://go.microsoft.com/fwlink/?LinkID=216771 Zakończono instalowanie platformy ASP.NET (4.0.30319.0). Zakończonoinstalowanie平台ASP.NET(4.0.30319.0)。

So I installed ASP.NET 4.5 but still error appears .. 所以我安装了ASP.NET 4.5,但仍然出现错误..

Behavior 2) Application compiles properly and runs in debug mode but:) .... images are not displayed. 行为2)应用程序正确编译并在调试模式下运行,但是:) ....图像未显示。 When I try to open one image directly like this http://localhost:30246/Content/images/logo.svg error appears: 当我尝试直接像这样打开一个图像时,出现http://localhost:30246/Content/images/logo.svg错误:

Error Code: 0x800700b7 错误代码:0x800700b7

Description (transalted from polish): 说明(从波兰语翻译而来):

Cannot add duplicate entry for collection with type mimeMap” with unique key value „fileExtension” set to „.json” 无法将唯一键值“ fileExtension”设置为“ .json”的mimeMap类型的集合添加重复项

Code: 码:

  112:     <staticContent>
  113:       <mimeMap fileExtension=".json" mimeType="application/json" />
  114:     </staticContent>

My fix:) 我的解决方法:)

I go to IIExpress configuration file C:\\Users\\XXX\\Documents\\IISExpress\\configapplicationhost.xml and commented out JSON entry: 我转到IIExpress配置文件C:\\Users\\XXX\\Documents\\IISExpress\\configapplicationhost.xml并注释掉JSON条目:

        <mimeMap fileExtension=".js" mimeType="application/javascript" />
     <!--   <mimeMap fileExtension=".json" mimeType="application/json" /> -->
        <mimeMap fileExtension=".jsonld" mimeType="application/ld+json" />

Project still give warning while opening but it seems to work. 项目在打开时仍会发出警告,但似乎可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM