Creating a Visual Studio console application for SharePoint is a good idea if you want to do a small POC (proof of concept). This saves good amount of time and the overhead of deployment and server reset. We will not focus on creating console application, but learn how to resolve/fix the most common error which developers face here - "FileNotFoundException was unhandled"
Error - System.IO.FileNotFoundException was unhandledThis error occurs because Visual Studio console applications run on the 32 bit mode by default, but SharePoint (2010 and above) is built on the 64 bit mode.
The error says - System.IO.FileNotFoundException was unhandled.The error description says - The Web application at http://yoursharepointsite could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
How to fix ?In order to fix the issue simply change the Build platform target to 64 bit (x64).
Step 1 - From the Solution Explorer, right-click on the project and click "Properties", click on "Build" and change the Platform target to x64 (64 bit). Save the changes.
Step 2 - Re-run your application and this time it will run as expected with any issues.
- That did'nt work, Issue type User not in directory - SharePoint external access error
- How to get SharePoint Online user details from person or group column using REST API
- Create SharePoint Site Collection with new Content database in existing web application
- Fix Power BI 404 not found error when connecting SharePoint Online List as Data Source
- How to get the SharePoint Tenant Login URL
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- SharePoint Server 2016 installation System Hardware requirements
- Cannot load PowerApps form in SharePoint Online due to repeated authentication
- Change SharePoint search results FullTextSqlQuery RowLimit 10000
- How to create SharePoint Document Library
- How to exclude results from SharePoint Search
- SharePoint 2010 DataForm Unable to display this Web Part System.StackOverflowException
- Fix Error 2711 SQL RBS client - The installer has encountered an unexpected error. The specified Feature name ('Docs') not found in Feature table
- How to upload file programmatically to SharePoint Document Library using Server Object Model C# .Net
- SharePoint error cannot connect to the configuration database
- Drag drop files here option missing for SharePoint document library
- How to activate and create SharePoint Spaces feature for mixed reality experience - 2D/3D images and web parts
- [Fix] Office 365 Sharepoint One Drive Error: Something went wrong. This is a temporary issue
- SharePoint 2016 error - Could not find file ManageUserProfileServiceApplicationTenantSimplified.xml
- SharePoint List excel import - This table exceeds the maximum number of supported rows
- How to customize SharePoint Modern list form using JSON formatting
- New-SPLogFile PowerShell - create new SharePoint log file
- SharePoint Online REST API not returning all list items and limit to only 100 rows
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell
- Get-ADUser PowerShell - Get AD user details using email address
- Fix: Cannot contact reCAPTCHA. Check your connection and try again. - Google
- Java SE JDBC with Prepared Statement Parameterized Select Example - Java
- Comparator with Lambda Examples - Java
- Android read text file from internal storage - Android
- The Date Command and its usage [Linux - Unix - macOS] - Linux
- Are Windows Notepad files recoverable? - NotepadPlusPlus
- TextEdit save file with txt extension - MacOS
- Android Studio : Build Tools 23.0.0 rc1 is deprecated - Android-Studio