Visual Studio 2010 Could not load file or assembly

Visual Studio build error: :
Error 15 Could not load file or assembly 'file:///C:\Documents and Settings\kumard\My Documents\Visual Studio 2010\Projects\LANSW.LMS\site\References\SwitchIT.DataAccess.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

Solution:

  • Right click on each *.dll file in Windows Explorer.
  • Uncheck “Read Only”.
  • Click “Unblock”.

If dll are stored in a network drive, move them locally and re-add your references.

Enable Web Services Enhancements (WSE) 3.0 in Visual Studio 2008 and 2010

Web Service Enhancements 3 (WSE 3) is not officially supported for Visual Studio 2008. The reason is that Microsoft wants you migrate your code to WCF. Use this work around to enable Web Services Enhancements (WSE) 3.0 in VS2008 and VS2010.

1. Download and install Web Services Enhancements (WSE) 3.0 for Microsoft .NET. Make sure you have all the files after installing WSE v3.0. Note: Close Visual Studio before installing.

WSE v3.0 Installation Filesn under Program Files

WSE v3.0 Installation Filesn under Program Files

2. Go to the folder %ALLUSERSPROFILE%\Application Data\Microsoft\MSEnvShared\AddIns (notice that “Application Data” is hardcoded, which shouldn’t because Windows XP localizes that folder). If the folder is not there close Visual Studio and create the folder as show below.

Examples:
- Windows XP: “C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\AddIns”
- Windows Vista / Windows 7: “C:\ProgramData\Microsoft\MSEnvShared\AddIns”

3. In the folder in step 2 you will find WSESettingsVS3.AddIn file. Backup WSESettingsVS3.AddIn before modifying. If its not there then create one with the file name WSESettingsVS3.Addin and type the content from the picture shown in step 4.

4. You’ll find two sections. Note that the version is 8.0. Copy and paste these two sections and change the version of the new sections to 9.0 (if using Visual Studio 2008) or 10.0 (if using Visual Studio 2010). Save the file.

WSESettingsVS3.Addin

WSESettingsVS3.Addin

5. Go to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE (if using Visual Studio 2008) or C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE (if using Visual Studio 2010) and open the devenv.exe.config file. Backup the devenv.exe.config file and add the following snippet just above the closing tag inside the file. This helps Visual Studio to generate web service proxy classes using WSE.

Visual Studio 2010 devenv.exe.config

devenv.exe.config

<system.web>
<webServices>
<soapExtensionImporterTypes>
<add type=“Microsoft.Web.Services3.Description.WseExtensionImporter,
Microsoft.Web.Services3, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35“ />
</soapExtensionImporterTypes>
</webServices>
</system.web>

7. Close all the instances of Visual Studio 2008 or Visual Studio 2010 and start the application again.

8. Open your project in VS2010 and right click on project to see the WSE Setting 3.0 option. Now you could configure WSE setting in VS2010. Good luck.

WSE Setting 3.0 under VS2010 project

WSE Setting 3.0 under VS2010 project

Reference:

Default .AddIn file locations for Visual Studio add-ins
How to use WSE 3 in Visual Studio 2008
Migrating WSE 3.0 Web Services to WCF
WSE 3.0 Setting Tool For Visual Studio 2008
How to use WSE 3 in Visual Studio 2008
How to use WSE 3 in Visual Studio 2010