Re: [ninject] Assembly loading error when using the factory extension

549 views
Skip to first unread message

Bartelink, Ruben

unread,
Apr 3, 2013, 11:02:48 AM4/3/13
to nin...@googlegroups.com
Where did you get the DLLs ?  I'm guessing you need to do Explorer Properties and Click Unblock.

(BTW It's insane not to get all these things from NuGet -- If you didnt encounter documentation telling you that, that's an issue someone[1] should care of)

--R



On 3 April 2013 15:55, Matthew Lund <ma...@lundfam.net> wrote:
I was just introduced to Ninject yesterday and am loving it so far!

Along with other fun, I got some samples to run that demonstrate the capabilities of the factory extension.  However, to get these samples to run I've had to put the following in an app.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <loadFromRemoteSources enabled="true"/>
  </runtime>
</configuration>

Otherwise, I get the following error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Dev\Prototypes\Ninject\Nin
jectPrototypes\Factory1\bin\Debug\Ninject.Extensions.Factory.dll' or one of its dependencies. Operation is not supported
. (Exception from HRESULT: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a
 network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This
release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not
intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?Li
nkId=155569 for more information.

I'm attempting to run the 3.0.2.13 Ninject.dll binary and the 3.0.2.6 Ninject.Extensions.Factory.dll which are compatible according to the teamcity site.  Aside from the app.config setting (which I fear might cause my Ninject pitch to get shot down), are you aware of any way around the error?

This occurred when I ran from both C:\Dev\XYZ as well as D:\Dev\XYZ.  So I'm not actually running it off a network mount as the error sounds like.

Any advice would be appreciated!

Matt

--
You received this message because you are subscribed to the Google Groups "ninject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninject+u...@googlegroups.com.
To post to this group, send email to nin...@googlegroups.com.
Visit this group at http://groups.google.com/group/ninject?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
--Ruben
Ruben Bartelink / +353 86 885 2399

Matthew Lund

unread,
Apr 3, 2013, 11:45:43 AM4/3/13
to nin...@googlegroups.com, ru...@bartelink.com
Oh my gosh, that was it.  I had checked these files into source control and every other machine that I tried worked fine.  Then after your message I deleted, re-got them from source and everything was great.

I downloaded them from http://teamcity.codebetter.com/project.html?projectId=project3

I'll NuGet them again right now just to make sure I've got stable versions.  Thanks for seeing my knuckle-headed mistake!
Reply all
Reply to author
Forward
0 new messages