无法加载index.cshtml [英] Unable to load index.cshtml

查看:66
本文介绍了无法加载index.cshtml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我将我的mvc网站上传到我的主站点的虚拟目录中,并配置了它的web.config,如下所示:





 <?  xml     version   =  1.0   编码  =  utf-8  >  
<! -
For有关如何配置ASP.NET应用程序的更多信息,请访问
http://go.microsoft.com/fwlink/?LinkId=301880
- >

< 配置 >

< connectionStrings >

一些数据

< / connectionStrings >


< appSettings >
< add key = 网页:版本 value = 3.0.0.0 < span class =code-keyword> / >
< add key = 网页:已启用 = false / >
< 添加 key = ClientValidationEnabled value = true / >
< add key = UnobtrusiveJavaScriptEnabled value = true / >
< add key = SiteNameInPersian value = فروشگاه / >
< add key = OrganizeNamePersian value = / >
< / appSettings >

< system.web >
< 编译 debug = true targetFramework = 4.5.2 / >
< httpRuntime targetFramework = 4.5。 2 requestValidationMode = 2.0 / >
< httpModules >
< add name = ApplicationInsightsWebTracking type = Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule,Microsoft.AI.Web / >
< / httpModules >

< /system.web >
< 运行时 >
< assemblyBinding xmlns = urn:schemas-microsoft-com:asm.v1 >
< dependentAssembly >
< assemblyIdentity name = System.Web.Helpers publicKeyToken = 31bf3856ad364e35 / >
< < span class =code-leadattribute> bindingRedirect
oldVersion = 1.0.0.0-3.0.0.0 newVersion = 3.0.0.0 / >
< / dependentAssembly >
< dependentAssembly >
< assemblyIdentity 名称 = System.Web.WebPages publicKeyToken = 31bf3856ad364e35 / >
< bindingRedirect oldVersion = 1.0.0.0-3.0.0.0 newVersion = 3.0.0.0 / >
< / dependentAssembly >
< dependentAssembly >
< assemblyIdentity name = System.Web.Mvc publicKeyToken = < span class =code-keyword> 31bf3856ad364e35 / >
< bindingRedirect oldVersion = 1.0.0.0-5.2.3.0 newVersion = 5.2.3.0 / >
< / dependentAssembly >
< / assemblyBinding >
< /运行时 >
< system.codedom >
< 编译器 >
< 编译器 language = c#; cs; csharp 扩展名 = .cs

类型 = Microsoft。 CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35

< span class =code-attribute> warningLevel = 4 compilerOptions = / langversion:6 / nowarn:1659; 1699; 1701 / >
< 编译器 language = vb; vbs; visualbasic; vbscript 扩展名 = 。vb

< span class =code-attribute> 类型 = Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35

warningLevel = 4 compilerOptions = / langversion:14 / nowarn:41008 / define:_MYTYPE = \& ; QUOT; Web\&安培; QUOT; / optionInfer + / >
< / compilers >
< / system.codedom >
< system.webServer >
< 验证 validateIntegratedModeConfiguration = false / >
< modules >
< 删除 name = ApplicationInsightsWebTracking / >
< add name = ApplicationInsightsWebTracking type = Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule,Microsoft.AI.Web

preCondition = managedHandler / >
< / modules >
< defaultDocument >
< files >
< clear / >
< add value = < span class =code-keyword>索引 / >
< add value = Default.htm / >
< add value = Default.asp / >
< add value = index.htm / >
< add value = index.html / >
< add value = iisstart.htm / >
< add value = default.aspx / >
< ; / files >
< / defaultDocument >
< / system.webServer &g t;
< / configuration >







但它没有加载,我看到了这个:


$ b $b l?? r<#?u ;F z

> o 8C:??!?!?q {q马里兰州一个Y 7 C $ ??? 2n个< wc60 efdvýč3rcn A` ??θC]?????? r y ?&b ?s c* ? 。= ͊ 'z4= a k 0?[0 ?? =? i q ? 4k =kq?ǒ ?? ?qc ?\b } dz=? 0?>%。 2) DV%?|?。?] XA%\t ??#??#d g'.H8eT ℃下HV>?> ??公元前#< 6JIVF * II;?·F̸? IN }I5 ?[} o
$ b $b ƶDz l& V9I]ɩ ?ݾR20:????ֹ? 3 S u ˝??k q?z βZ?? C; + ?

? Gv #A =? n A؂ A Zt 4J ʘ* ? 8?!?d cN 薀r? #?? w'

:8? kҏ< w Pg P?? 6:% &? U??? * ?Z ?}

1?BQ%?7 0- ?? J (

? ? . ψ?i + `A \-? 0? ` g 〜? T p E2V = Bh4
$ b $b D S ?K ? j %֢q ? 2 lb ) U ?靱 靱N V O ģ` : o \\\ E? ? T: :w? 7

{ q

?z?_l nf ꗸ~ ? C q yn _? 夏 = x ?? .8 ? G?A $ ^ fHu
$ b $bd4 Q? 2l.g?? A rC + ݫ一个(/'-H f4babJe C [:???a.`? z ??Gg @?} q? ā;
$ b $b Z` vб h# xL



我尝试过:



我用简单的html代码更改了我的索引文件我改变了我的web.config但我没有加载。

解决方案

?? 2 n <wc 6 0 ?e fdv ?y ?č?3rcn ?a `?? θc] ?r y ?&b ?s c * ? 。= ͊ 'z4= a k 0?[0 ??=?i q ? 4k =kq?ǒ ??? QC \b}dz= 0? >???%2)的Dv%|] XA %\t ??#??#d g'.H8eTC<?HV>?> ??公元前#< 6JIVF * II;?????F的̸IN} I5 [} 0 $ b $b ƶDz l& V9I]ɩ ?ݾ ?r 2 0 :???? ?? 3 S u ˝??k q?z βZ?? C; + ?

? Gv #A =? n A؂ A Zt 4J ʘ* ? 8?!?d cN 薀r? #?? w'

:8? kҏ< w Pg P?? 6:% &? U??? * ?Z ?}

1?BQ%?7 0- ?? J (

? ? . ψ?i + `A \-? 0? ` g 〜? T p E2V = Bh4
$ b $b D S ?K ? j %֢q ? 2 lb ) U ?靱 靱N V O ģ` : o \\\ E? ? T: :w? 7

{ q

?z?_l nf ꗸ~ ? C q yn _? 夏 = x ?? .8 ? G?A


^ fHu
$ b $bd4 Q? 2l.g ??弧+ݫ一个(?/'-H?f4babJe 2 C [:a. ? z??Gg @?} q? ā;
$ b $b Z` v б h# xL



我的尝试:



我用简单的html代码更改了我的索引文件,我改变了我的web.config但是我没有加载。


索引文件可能用不同的编码保存?或者它是不是呈现为text / html?



如果您输入列出的所有文件,还要从配置中注明?这似乎不是很好的做法,肯定会很困难维持。



 <   defaultdocument  >  
< files >
< clear >
< add value = 索引 >
...
< / add > < / clear > < / files >
< / defaultdocument >


Hi I uploaded my mvc web site in a virtual directory of my main site and I configured its web.config as shown below:


<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>

  <connectionStrings>

some data
    
  </connectionStrings>


  <appSettings>
    <add key="webpages:Version" value="3.0.0.0"/>
    <add key="webpages:Enabled" value="false"/>
    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
    <add key="SiteNameInPersian" value="فروشگاه"/>
    <add key="OrganizeNamePersian" value=""/>
  </appSettings>

  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2" requestValidationMode="2.0"/>
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
    </httpModules>
    
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"

        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"

        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ApplicationInsightsWebTracking"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"

        preCondition="managedHandler"/>
    </modules>
	  <defaultDocument>
      <files>
        <clear />
        <add value="Index" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="index.html" />
        <add value="iisstart.htm" />
        <add value="default.aspx" />
      </files>
    </defaultDocument>
  </system.webServer>
</configuration>




but it doesn't load and I see this:

�lr<#u�;F�z
���>����o��8��C�:"�?�̀q{q���!Md���a�ͮ���ÿ�!7�!��c��$ ����2�n"��<wc��6���0��e����fdv�y��č3rcn�?a�`���ϑc]��r�y�&b�s� �c*����.="" �͊��'z4="" �a�k�0[0��="" i�q��4k�="" k.qǒ�����qc�\b���}�dz="�0">%.�2)��Dv%|������]XA��%\�t�#����#.�d�g���'.�H8���eT��C<��h�v>��>b���C��#��<6j"Iv�F*II;���F��̸��IN�}I5���[}o
��ƶDz�l&�V9I]ɩ�ݾ�r�2�0�:�ֹ�� �3�S�u�˝ k��qz��βZC;�+�
�Gv�#A=�n�A؂�A��Zt�4J�ʘ*�����8!d�cN���� 薀r�#�w'
:8�kҏ<�w�Pg���P�6:%�&��U*�Z��}
1BQ%7�0-��J�(���
� ��.��ψi�+�`A�\-���0��`���g�~�T���p�E2V�=�Bh4
��D�S�K��j��%֢q���2�lb�)�U��靱�ķN��V�O�ģ`�:��o����\u�E���T:��:w�7
��{��q
��z_l��nf�����ꗸ~��C�q�yn�_�夏����=���x������.8���GA$��^fHu
d4�Q�2l.g���A�rC�+�ݫa�(/ʻ-H���f4�b�a�b��J��e�����������C�[:a.`����zGg��@}q�ā;�
����Z`��v�h#��xL��

What I have tried:

I changed my index file with simple html code and I changed my web.config but I doesn't load.

解决方案

����2�n"��<wc��6���0��e����fdv�y��č3rcn�?a�`���ϑc]��r�y�&b�s� �c*����.="" �͊��'z4="" �a�k�0[0��="" i�q��4k�="" k.qǒ�����qc�\b���}�dz="�0">%.�2)��Dv%|������]XA��%\�t�#����#.�d�g���'.�H8���eT��C<��h�v>��>b���C��#��<6j"Iv�F*II;���F��̸��IN�}I5���[}o
��ƶDz�l&�V9I]ɩ�ݾ�r�2�0�:�ֹ�� �3�S�u�˝ k��qz��βZC;�+�
�Gv�#A=�n�A؂�A��Zt�4J�ʘ*�����8!d�cN���� 薀r�#�w'
:8�kҏ<�w�Pg���P�6:%�&��U*�Z��}
1BQ%7�0-��J�(���
� ��.��ψi�+�`A�\-���0��`���g�~�T���p�E2V�=�Bh4
��D�S�K��j��%֢q���2�lb�)�U��靱�ķN��V�O�ģ`�:��o����\u�E���T:��:w�7
��{��q
��z_l��nf�����ꗸ~��C�q�yn�_�夏����=���x������.8���GA


��^fHu
d4�Q�2l.g���A�rC�+�ݫa�(/ʻ-H���f4�b�a�b��J��e�����������C�[:a.`����zGg��@}q�ā;�
����Z`��v�h#��xL��

What I have tried:

I changed my index file with simple html code and I changed my web.config but I doesn't load.


The index file may be saved with different encoding? Or it is not rendered as text/html?

Also noting from the config, should you be inputting all files as listed? This does not seem good practice and surely would be difficult to maintain.

<defaultdocument>
<files>
        <clear>
        <add value="Index">
...
</add></clear></files>
</defaultdocument>


这篇关于无法加载index.cshtml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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