Debugging an existing sharepoint solution - visual-studio-2010

I've recently mapped a sharepoint solution from TFS to a local directory and successfully 'got' the latest version.
It wasn't building, but this was because of there were no Site URL's in the properties of the several projects included in the solution. So, using central admin, I created a new web app (the port 36352). U then added the url and port to the Site Url and it's now building fine.
However, when I go to run with the debugger I get the following two errors:
Error 2 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: :36352/">http://:36352/ (deleted url for security reasons). Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
AND
Error 3 Program 'Path.PowerShell.exe' (deleted path for security reasons) does not contain a static 'Main' method suitable for an entry point
It seems that the first error is related to the way in which I've 'connected' it to the new web app I've created - have I done this part right?
The 2nd error seems to be with regard to the entry point at which the debugger should execute, but this is a sharepoint site - so I just want to run the site (has VS not identified this as sharepoint somehow?).
Thanks a LOT for any help.

I got this exception when I had the solution on a different server. Make sure your solution is on the same server as the SharePoint web application. When you run the solution, Visual studio packages the solution and tries to deploy it onto the URL you specified in the properties. If your project is a farm solutions such as visual web part then make sure you have rights to deploy.

Related

Sitecore Cannot open database "marktwoSitecore_Web" requested by the login. The login failed. Login failed for user 'blah''

I am currently trying to set-up a Sitecore project on my PC. When I go to view the project on my browser I get the following error:
Sitecore Cannot open database "marktwoSitecore_Web" requested by the login. The login failed. Login failed for user 'blah''.
These are the steps that I have carried out so far:
1) Firstly there are three types of sitecore installations to do:
- Complete
- Database only
- Client only
I have gone with the Client only installation.
2) The Sitecore "Client-only" installation instance was made inside the inetpub/ wwwroot folder.
3) I then made a visual studio project
4) I made a folder called "Libraries", which is located in the root of my visual studio project solution. I copied over all the relevant Sitecore.dll's from the wwwroot project to my visual-studio project into the Libraries folder. I also replaced the Default web.config file in my Visual studio project with Sitecore's version of Web.config. And then I added Sitecore references to my Visual Studio project.
6) With all of the initial configuration done; I set-up a publish profile so that I could publish my C# code to inetpub/wwwroot project. I did step four so that my publish would not overwrite sitecore dlls.
5) I changed the Connection strings in App_Config/ConnectionStrings.config to point to the Web, core and master sitecore databases. That were created during the Sitecore installation.
Those were the steps I did prior to getting the error about invalid login credentials. I am not sure why I am getting this error; since I went into Microsoft SQL server Management Studio and I gave the user "blah" admin rights to all of the datbases: Master, web and core.
Any support and guidance would be greatly appreciated; as I am unsure of how to address this problem
This error is happening because the web database referenced in your Website/App_Config/ConnectionStrings.config is either not there or the permissions are not set properly on that database. The easiest way to troubleshoot is to load SQL Server Management Studio specifying the host, username and password that are in your connection strings and see if it connects. It sounds like you are probably logging in with your Windows user when you are making the changes listed above.
You could try making the blah user a "db_owner" to see if that helps or your local instance may not be in "mixed authentication mode" which allows for named users and windows users. You can change that in the settings, but you need to restart the service for it to take effect.

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

MVC6 Web API - How to deploy

I downloaded and installed the RTM of VS 2015, got my Web API project working nicely, can hit F5 all works in IIS Express, lovely. But now I go to deploy my WebAPI on a local network server and oh my! I was hoping to find the publish to File System option and then to be allowed to select IIS but it ain't there. Publish to file system is there but that compiles wwwroot and approot folders and for the life of me I haven't been able to get them's files to run under IIS - tried all sorts, ege approot as my website root on IIS, wwwroot as my website root. I've found plenty of reference to show you how to deploy Web API ASP 5 to Azure but have as yet been unable to locate any information for how to deploy to IIS on network.
Just got it to work, for the sour down voter here's how
Right click WebAPi project select Publish
Profile -> Select File System
Connection Target Location browse to somewhere that makes sense eg. C:\inetpub\WebAPI
Settings ->Configuration select Release
Settings Target DNX Version select x64 example dnx-clr-win-x64.1.0.0.beta4
In IIS set the Physical Path of your website to be C:\Inetpub\WebAPI\wwwroot
Test eg localhost/api/Values

Sharepoint customization wizard - can't deploy as a farm solution

Whenever I try to connect with the url (Sharepoint customization wizard, with option deploy as a farm solution) of the solution after creating a new sharepoint 2010 solution with the VS 2010 ultimate and I can't connect it, but I can access it in the browser.
I am running visual studio as administrator.
It gives me the error:
"Cannot connect to the Sharepoint site: [site name].org.br.
Make sure that the Site URL is valid, that the SharePoint site is running on the local computer, and that the current user as the necessary permissions to access the site.
Additional Information:
It is working without need to making package, automattically, (just pressing F5) on the localhost, but is not working in the network intranet solution.
Cannot connect to the Sharepoint site: [site name].org.br.
Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project."
Maybe it is required to use the Visual Studio Team Foundation Server to be able to make it to work.
EDIT: Was an error with the anti-virus at the network.
Now I can connect to the project, but cant deploy.
Now I have a problem when deploying it, it gives me a new error.
Recycle the IIS application pool:
Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://[website]. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

Problem running MVC3 under IIS 7.5

I am trying to make Visual Studio 2010 to run my project under a local instance of IIS 7.5 instead of starting the web development server. There is no problem deploying it to IIS, but when i try to browse to the site, it's like the routes never been registered in IIS because i get error "The Web server is configured to not list the contents of this directory." when i try to browse "http://localhost/returnjson", and when i browse "http://localhost/returnjson/Home/Index" i get error 404. And there is nothing wrong with the routes in my project, it works under web development server. What could be the problem?
It's hard to say what's wrong here but there are a couple of things you could try.
You could be looking at the wrong application. IIS comes pre-configured with a default application that acts as a catch all. Any unmapped domain name will end up there. So, by default when you visit localhost you'll end up there.
If you deployed your application into a new IIS site, make sure you bind it a proper domain name like myapp.local. Then add that domain name to your hosts file (%Windows%\System32\Drivers\etc\hosts) and map it to IP 127.0.0.1.
Another thing that could be wrong is that your IIS configuration is a bit screwed up. It happens sometimes. You can fix that with aspnet_regiis like so:
aspnet_regiis -ir
This tool is located under:
%Windir%\Microsoft.NET\Framework\v4.0.30319
Right click on your MVC3 project and select Publish. Publish it to the Filesystem and select a folder on your hard drive.
Navigate to your published folder and copy everything in it.
It's a pain in the keister but you can get through it.
Your folder in C:\inetpub\wwwroot should look like this after pasting your published application into the wwwroot:
Can you confirm that your folder looks like this?
You could also try out IIS Express in stead of IIS 7.5
IIS Express is a lightweight, self-contained version of IIS optimized for developers. IIS Express makes it easy to use the most current version of IIS to develop and test websites. It has all the core capabilities of IIS 7 as well as additional features designed to ease website development

Resources