Solved

.Net Error

Posted on 2012-04-04
8
444 Views
Last Modified: 2012-04-24
I currently trying to run a program that uses .NET, from my XP Pro PC, from my PC the program accesses a file locate on a file 2003R2 share server but the process fail and I get this message:

['M:\test\AOD\Document Actions\FileName.cs': 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/?LinkId=155569 for more information.]

Now from the same PC I can copy the same files locally to the PC and it works, I check my permissions for that user on the server and that user has rights, any thoughts?

Thanks.
0
Comment
Question by:ahmad1467
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 37810186
right click on the executable and select unprotect (if it shows this)
or in your Visual Studio 10 modify the devenv.config
and add <loadFromRemoteSources enabled=true />

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.config

Make sure you run your editor i.e. notepad as an administrator or your edit will be virtualized and not come into effect.

Now rebuild your program.
0
 
LVL 81

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 37810210
<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>
0
 

Author Comment

by:ahmad1467
ID: 37827551
I tried right clicking on the executable but I did not  get the option to  select unprotect, then on the workstation I went to look for Visual Studio 10 modify the devenv.config  but the only file I could find is { C:\Program Files\Microsoft Visual Studio\COMMON\IDE\IDE98\ASP.TLB
Also on the server that holds the file that the workatation is trying to access I tried to find the directory and all I could find is [C:\Program Files\Microsoft Visual Studio 8\Common7\IDE] but I don’t see the file [devenv.config] only .config file I see in this folder is [PEVerify.exe.config]
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 37827650
Which version of visual studio do you have installed and on what platform? The executable has to be recompiled.

Don't worry about the 2k3 box as you probably only have VS runtimes installed on it.

and it should have been devenv.exe.config
devenv.exe.xml
0
 

Author Comment

by:ahmad1467
ID: 37828452
The program that I am trying to run is an application that has been installed on the PC ,
Visual Studio is not installed on the PC.The application runs locally on the PC but the data is on the Files share server, and this is when I get the error. Now if I copy the same data that is located on the server locally to the PC it works. There is a link in the error that tells me to add this code

<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>
 But I’m not sure where.
0
 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 37829810
n your program directory look for a file  file called ProgramName.exe.Config – this is an xml document which sets out many configuration settings. Open this with any text editor (by the way, have you tried Notepad++ ?), and right before the final closing </configuration> tag, insert the following:
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>

Now once you restart that program, you should be able to load files from networked locations, and the management of your .NET programs is now that little bit easier.
0
 

Author Comment

by:ahmad1467
ID: 37832546
I went into the program directory and I found about five different .exe.Config.files .
The one that I found closes to the [ProgramName.exe.Config] looked like this

[<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="Program.Ur.Engine.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
        </sectionGroup>
    </configSections>
    <system.serviceModel>
        <bindings/>
        <client/>
    </system.serviceModel>
    <applicationSettings>
        <Program.Ur.Engine.Properties.Settings>
            <setting name="Provr_Engine_YoDesignpS50_Service" serializeAs="String">
                <value>http://localhost:80</value>
            </setting>
        </Program.Ur.Engine.Properties.Settings>
    </applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>]

Does this look like it could be the one?
0
 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 37834309
what is the executable that you start the program with .. typically that is the .config you need to change. You may have to change them all. Easier for the programmer to just change visual studio and then recompile the program
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question