none
.Net 4.0 and VS2010 with sources from network drive RRS feed

  • Question

  • \

    Our corporate environment rely heavily on network drives mapped to local machine.

    In the VS2010 and .Net framework 4.0 environment, this causes various problems such as an error stating "Could not load file or assembly 'file://\\fileserver\references\ReferencedAssembly.dll' or one of its dependencies. Operation is not supported."

     

    We tried to enable loadFromRemoteSources in the machine.config, which should make a machine-wide policy change, but we still found that in order to use the .Net 4 regasm.exe for assemblies from the network drive, we needed to enable loadFromRemoteSources in the regasm.exe.config file. Also in order to view and run UnitTest in the VS2010 IDE and command prompt, we needed to enable loadFromRemoteSources in devenv.exe.config, QTAgent32.exe.config and MSTest.exe.config. We don't know whether there are other config files we need to change too.

    My first questions is: Why the machine.config change does not apply to those applications?

     

    Also, <loadFromRemoteSources> affects not only assemblies loaded from the Intranet zone, but from the Internet zone as well.

    My second questions is: Is there a way to specify certain network drive to have full trust so we don't turn on the trust for Internet zone as we did by using the loadFromRemoteSources?

     

    Friday, June 10, 2011 6:20 PM

All replies

  • Hi,

     

    Thank you for your question, we're doing research on this case, it might take some time before we get back to you.


    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 13, 2011 9:51 AM
  • 1. My first questions is: Why the machine.config change does not apply to those applications?

     

    Answer:- It is because machine.config is only used if CAS(Code Access Security) is enabled. CAS is not enabled by default for .NET 4.0. CAS does not exist in .NET 4.0 (unless you specifically enable it). No CAS, means any settings have to be applied per process/application.

     

    2. My second questions is: Is there a way to specify certain network drive to have full trust so we don't turn on the trust for Internet zone as we did by using the loadFromRemoteSources?

     

    Answer:- There is no way to specify certain network drive to have full trust as there is no CAS in .NET 4.0. Hence, we cannot specify any particular drive to have full trust.

     

    Also, you can read http://msdn.microsoft.com/en-us/library/ff558825.aspx to get more details.


    --Trevor H.
    Send files to Hotmail.com: "MS_TREVORH"
    Wednesday, June 15, 2011 6:12 PM
    Moderator
  • Bo2010,

    As you've opened a support case with us, we're going to stop monitoring this thread now. Please loop back here and post the outcome of your support case when it's complete, regardless of result, for the benefit of the community.


    --Trevor H.
    Send files to Hotmail.com: "MS_TREVORH"
    Thursday, June 16, 2011 3:39 PM
    Moderator