我从源(压缩档)建立单3.0.2,并内置XSP来自最新的tar包和最新的Github上,但我不能,因为它看到“运行使用.NET 4.5的相对简单的asp.net应用targetFramework = “4.5””在web.config为无效。 构建应用程序,并运行一个控制台.NET 4.5的应用程序工作得很好。
这是有问题的web.config中:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="owin:HandleAllRequests" value="true" />
<add key="owin:SetCurrentDirectory" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
这是xsp4抛出异常:
An exception has occurred while generating HttpException page:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Web.Util.HttpEncoder.GetCustomEncoderFromConfig () [0x00000] in <filename unknown>:0
at System.Lazy`1[System.Web.Util.HttpEncoder].InitValue () [0x00000] in <filename unknown>:0
The actual exception which was being reported was:
System.Web.HttpException: Initial exception ---> System.Configuration.ConfigurationErrorsException: Error deserializing configuration section httpRuntime: Unrecognized attribute 'targetFramework'. (/home/srobbins/Projects/nancykatana/NancyKatana/Web.config line
1)
at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
at System.Web.HttpRuntime..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
而关于版本/配置的一些信息:
xsp-2.11
Build Environment
Install prefix: /usr/local
Datadir: /usr/local/share
Libdir: /usr/local/lib
Build documentation: yes
Mono 2.0 compiler: /usr/local/bin/gmcs
Mono 4.0 compiler: /usr/local/bin/dmcs
Target frameworks: .NET 2.0, .NET 4.0
Build SQLite samples: yes
srobbins@ubuntu-vm:~/Downloads/xsp$ /usr/local/bin/mono --version
Mono JIT compiler version 3.0.2 (tarball Tue Jan 8 08:23:06 GMT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
srobbins@ubuntu-vm:~/Downloads/xsp$
如果我从web.config中删除targetFramework元素则错误消失,但我只是得到一个404,所以没有一个HTTP模块越来越迷上了。
有任何想法吗? 我已经告诉xsp4应该工作得很好,但是从我所看到的简化版,它似乎已被更新,以处理4.5可言。