Skip to main content
deleted 4 characters in body
Source Link
Sergei Sergeev
  • 11.6k
  • 5
  • 32
  • 49

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

UPD:

For SharePoint 2013 thisThis method is obsolete in SharePoint 2013, and you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath

Thanks for noticing that fact in comments.

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

UPD:

For SharePoint 2013 this method is obsolete, and you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath

Thanks for noticing that fact in comments.

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

UPD:

This method is obsolete in SharePoint 2013, you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath

Thanks for noticing that fact in comments.

added more info according sp2013
Source Link
Sergei Sergeev
  • 11.6k
  • 5
  • 32
  • 49

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

UPD:

For SharePoint 2013 this method is obsolete, and you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath

Thanks for noticing that fact in comments.

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");

UPD:

For SharePoint 2013 this method is obsolete, and you should use GetCurrentGenericSetupPath or GetVersionedGenericSetupPath

Thanks for noticing that fact in comments.

Source Link
Sergei Sergeev
  • 11.6k
  • 5
  • 32
  • 49

Since your file in _layouts directory, why not to use GetGenericSetupPath method? Something like this:

var path = SPUtility.GetGenericSetupPath(@"TEMPLATE\LAYOUTS\MyPoject\data.xml");