当我调用时,我得到了这个堆栈跟踪:
XslCompiledTransform.Transform(XmlDocument.DocumentElement.CreateNavigator(), null, StringWriter)
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Runtime.Serialization.SerializationException: Type is not resolved for member --MyProject stuff
at System.AppDomain.GetHostEvidence(Type type)
at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GenerateHostEvidence(Type type, Boolean hostCanGenerate)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.get_HasRoamingConfig()
at System.Configuration.ClientConfigurationHost.IsConfigRecordRequired(String configPath)
at System.Configuration.BaseConfigurationRecord.hlNeedsChildFor(String configName)
at System.Configuration.Internal.InternalConfigRoot.GetConfigRecord(String configPath)
at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Xml.XmlConfiguration.XmlReaderSection.get_ProhibitDefaultUrlResolver()
at System.Xml.XmlTextReaderImpl.get_IsResolverNull()
at System.Xml.Xsl.QueryReaderSettings..ctor(XmlReader reader)
at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at MyProject
XslCompiledTransform 对象将使用 GetManifestResourceStream 的 XmlReader 加载到嵌入的 .xslt 文件中,但我已经确认它可以正确获取该信息。
我已经看了很多,并将其缩小到这个电话,但我不知道从这里去哪里。有没有其他人经历过这个?
这是在 Windows 8 机器上,但我在 server2008r2 操作系统上体验过