WinForm/Console 또는 내 경우에는 VS Unit Test와 같은 비 asp.net 응용 프로그램 내에서 표준 XmlSiteMapProvider를 사용하기위한 해결 방법이 있는지 궁금합니다.WinForm/Console/VSTest 응용 프로그램 내에서 XmlSiteMapProvider를 사용할 수 있습니까?
GetConfigDocument
메서드 내에서 .sitemap
파일에 대한 경로를 만들 수 없으므로 다음 코드는 실패합니다.
XmlSiteMapProvider provider = new XmlSiteMapProvider();
NameValueCollection providerAttributes = new NameValueCollection();
providerAttributes.Add("siteMapFile", "Web.sitemap");
provider.Initialize("XmlSiteMapReader", providerAttributes);
provider.BuildSiteMap();
다른 솔루션을 작성하는 것이 올바른 해결책이라고 생각합니다.