Visual Studio 2010 access denied on “Publish”

I was getting the errors below when publishing to a file system:

Connecting to C:\inetpub\wwwroot\webapp
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Publishing folder /…
Unable to add ‘Web.config’ to the Web site.  Unable to add file ‘Web.config’.  Access is denied.
Publishing folder Account…
Publishing folder bin…
Unable to add ‘bin/webapp.dll’ to the Web site.  Unable to add file ‘bin\webapp.dll’.  Access is denied.
Unable to add ‘bin/webapp.pdb’ to the Web site.  Unable to add file ‘bin\webapp.pdb’.  Access is denied.
Publishing folder Scripts…
Publishing folder Styles…
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

The fix: Open Visual Studio 2010 with “Run as Adminstrator” (right-click it and choose that option).

Using Visual SourceSafe 2005 with Visual Studio 2010

You may notice that when you attempt to add your solution to a source control in Visual Studio 2010, that it only shows a TFS server as a choice. Don’t be alarmed, however, just:

1. Go to Tools > Options.

2. Click Show all settings if not checked, then go to Source Control.

3. Go to Plug-in Selection, then change the dropdown to Microsoft Visual SourceSafe.

4. That’s it!

Happy Trailing!

Web Service Reference in Visual Studio 2010

If you’ve used Visual Studio 2008 or 2010, you’ll notice that Web Reference is no longer there (like in VS 2005 and previous), instead, you see Service Reference – actually, it’s STILL there, just hidden!

So, what’s the difference?  Well, according to this post:

Add Web Reference is the old-style, deprecated ASP.NET webservices (ASMX) technology (using only the XmlSerializer for your stuff) – if you do this, you get an ASMX client for an ASMX web service. You can do this in just about any project (Web App, Web Site, Console App, Winforms – you name it).

Add Service Reference is the new way of doing it, adding a WCF service reference, which gives you a much more advanced, much more flexible service model than just plain old ASMX stuff.

So, how do you access it?  Simple — right-click on Service References in the Solution Explorer window and…

image

Click on “Advanced…”

image

Then click on “Add Web Reference…”

image

Voila!  You can now consume the web service like you did pre-Visual Studio 2008 era.  Happy coding!