Sunday, September 12, 2010

"FileNotFoundException was unhandled" SharePoint 2010 newbies error

היי,

את השגיאה שבנושא קיבלתי בעת הרצת האפליקציה על מכונה חדשה שהתקנתי.

בעת הרצת אפליקציית קונסול יש לוודא לאיזו פלטפורמה מגודרת האפליקציה. כברירת מחדל , אפילו על מכונת 64 ביט, הויז'ואל סטודיו מותאם לרוץ לפלטפורמה של 32 ביט. לכן בעת ריצה ושימוש בקלאסים של שרפוינט , אנחנו נעוף מהסיבה הפשוטה שהם מותאמים ל 64 ביט, אז ברגע שננסה להשתמש באובייקט ששייך לשרפוינט נעוף על השגיאה שבנושא.

הפתרון פשוט מאוד - לכו להגדרות הפרויקט/אפליקציה שלכם , ועדכנו תחת הגדרות הבנייה (build) שזה ירוץ על סביבת 64 ביט.

שימו לב, שרפוינט רץ היטב רק בדוט נט 3.5 אם תחליפו את הפרויקט שלכם ל4 ( למשל , בשביל להשתמש ביכולות יותר מתקדמות לרכיבי אופיס ) גם תקבלו תעופה.

בהצלחה.

"FileNotFoundException was unhandled" SharePoint 2010 newbies error

Hi,

Some error that I had just when I started working on the SharePoint 2010 machine. I tried to investigate the SharePoint 2010 API , but surprisingly even trying to create an SPSite object cause a runtime error.

The reason is that you Visual Studio is set for running a 32 bit application, and SharePoint 2010 is 64 bit of course.

The only thing you need to do is to go to the properties of your application/project, then change under the Build tab - the platform target to x64.

Now re-run your console application.

Done.