5

I got the following error when running my first HelloWorld Windows phone 7 application.

Could not load the assembly file://\linkdotnet.local\linkdev\salma.mohamed\my documents\visual studio 2010\Projects\Assign1\Assign1\obj\Debug\Assign1.dll. This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.

Any Idea how to resolve it. Thanks alot in advance.

Salma Hamed
  • 2,000
  • 4
  • 26
  • 45

3 Answers3

15

I am assuming this assembly was in a zip file you downloaded from the internet? if that is the case you need to 'unblock' it. Right click the assembly within Windows Explorer, the click the 'unblock' button. See the example below:

enter image description here

ColinE
  • 68,894
  • 15
  • 164
  • 232
1

A likely cause of this error is if you load you Windows Phone project from a network share. Visual Studio will not trust the DLLs in this case. If you move the project folder to a local machine it will work (if this is the issue in your case)

www.jensolsson.se
  • 3,023
  • 2
  • 35
  • 65
0

ColinE this is not that at all:

This error is typically when you didn't have followed the unlock process as requested by MS and compile on the device instead of Emulator.

To unlock, follow the MSDN steps:

  1. Turn on your phone and if necessary unlock the phone screen.
  2. On your phone, ensure that the date and time are correct
  3. Using the USB cable that came with your phone, connect your phone to your computer
  4. On your computer, the Zune software starts automatically. If Zune does not start, then start it manually.
  5. On your computer, click Start, click All Programs, and then click Windows Phone SDK 7.1.
  6. Click Windows Phone Developer Registration.

The application starts, as shown in the following image. Verify that the Status message displays Phone ready. Please enter your Windows Live ID and password and click "Register" to begin.

f your phone is already registered, the Status message will indicate this and you will see an Unregister button.

  • Enter the Windows Live ID and password that correspond to your App Hub membership.
  • Click Register.

As referenced in MSDN

that way you will always be able to use your phone to test your application "in situ" instead of the emulator.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
dlewin
  • 1,673
  • 1
  • 19
  • 37