Context:
Windows XP
Visual Studio 2010
.NET 2.0
Problem:
I have this code:
xslt.Load(reportXslFilename, XsltSettings.TrustedXslt, null);
When I ran it in .NET 4.0, it worked fine. When I switched my project to .NET 2.0, I started getting this error:
System.Xml.Xsl.XslLoadException {"Default parameter specifiers are not permitted"}
Stack trace:
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)
...
Solution:
I had script and something like this:
public string SayHello(string name = "World") {
return "Hello " + name;
}
As you can see here, I have the default value for the parameter "name."
Removing this fixed my problem.