在我的ASP.Net MVC项目中,代码如下:
<div>
@{
XDocument doc = new XDocument(); //new XDocument.(Model.Page as CMSPageRequest).ContentDocument;
doc.Add(Model.Content);
XmlDocument xmlDoc = new XmlDocument();
using (var xmlReader = doc.CreateReader())
{
xmlDoc.Load(xmlReader);
}
XslTransform transform = new XslTransform();
String _SitePath = ConfigurationManager.AppSettings["PageFilesLocation"];
transform.Load(_SitePath + "/stylesheets/formMVC.xsl");
StringWriter writer = new StringWriter();
transform.Transform(xmlDoc, null, writer);
var result = writer.ToString();
@Html.Raw(result)
}
</div>
抛出以下错误:
我阅读了MS支持文章并更新了我的&#39; web.config&#39;以下内容:
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
...但错误信息仍在发生。关于我还能尝试什么的任何建议?提前致谢!