模板错误asp

时间:2014-02-11 10:13:42

标签: asp.net-mvc-3 razor mono monodevelop

我终于让我的monodevelop创建了一个mvc3 razor项目,但并非一切正常。当我尝试创建一个视图时,它说它找不到模板。此外,当我尝试创建项目时,它说:

System.IO.FileNotFoundException: Could not find file "/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml".
File name: '/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml'
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x0032f] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:320 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:132 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.File.OpenRead (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:341 
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x00077] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:189 
  at System.IO.StreamReader..ctor (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:165 
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.ReadAllText (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:537 
  at MonoDevelop.Ide.Templates.TextFileDescriptionTemplate.CreateContent (System.String language) [0x00027] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs:77 
  at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateContent (MonoDevelop.Projects.Project project, System.Collections.Generic.Dictionary`2 tags, System.String language) [0x00003] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:311 
  at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateFileContent (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String fileName, System.String identifier) [0x0001a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:264 
  at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.SaveFile (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String baseDirectory, System.String entryName) [0x0006b] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:204 
  at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x0000a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:113 
  at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00009] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:108 
  at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102 
  at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102 
  at MonoDevelop.Ide.Templates.ProjectDescriptor.InitializeItem (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage, MonoDevelop.Projects.SolutionEntityItem item) [0x00224] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs:162  

我必须创建视图,因为它在开始时不会创建一个视图。

我试图找到razorview引擎的模板,但我找不到它们。

1 个答案:

答案 0 :(得分:4)

我自己就是这个问题。我正在使用arch linux。

我收到错误后,我卸载了monodevelop,但没有依赖。然后我去了:

    https://github.com/mono/monodevelop

并按照那里的说明进行操作。我用了

    git clone https://github.com/mono/monodevelop.git
    cd monodevelop
    git submodule update --init --recursive
    ./configure --profile=stable ; make ; sudo make install

然后我进入monodevelop并用剃刀创建了一个MVC 3项目并且它正好打开了。没问题。