Monday, September 6, 2010

VS-2010-This setup requires the .net framework version 4.0 for setup projects

In order to avoid this error please make sure below things:

Target Framework of your application should be less than Framework 4.0 if you do not want it dependent on .net framework 4.0.
In the setup project, double click on Microsoft Net Framework under Detected Dependencies. Now open the properties of Net Framework, and select any framework less than 4.0.

Happy Coding.
Hope it helps.

VS-2010-The type or namespace could not found

 Description: When we create any application(in my case it was a console application) using VS 2010 and try to build it gives “The type or namespace could not found“ error (for me it gives me for Microsoft.Sharepoint), although it was showing added.
 Resolution: The reason was in the properties of project. Target Framework was by default selected as .Net Framework 4 Client Profile. But as per Microsoft: “If you are targeting
the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.” So as soon as I changed it to either .Net Framework 4.0 or 3.5, it started working.
Happy coding.
Hope it helps.

VS 2010 - Web Application could not be found

1. Problem:
 Description: If we try to open a site using a SPSite object in a project (in my case it was console application) created using VS 2010 , and it gives following error:
“The Web Application at 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.”
 Resolution: We all are aware of that there might be lot of other reasons for this error but I got this error during execution of a console application and the cause was, Platform Target is by default selected as x86, as soon as I made it AnyCPU, my application started working.

Happy Coding. Hope it helps.

Sunday, September 5, 2010

App Pool Name if specified with space, will always take Network Service as account

I have came across a wierd problem which I want to share with all so that they should not struggle to solve the problem.
Whenever a web application is created using wss object model, we have to specify various parameters out of which one is App Pool Name. So be careful while specifying the name, do not give any space in the application pool name. If app pool name will contain any space it will not use the specified credentials, rather it will always use Network Service as it credentials.
Hope it helps someone.
Happy Coding :)