Solved

.Net Error

Posted on 2012-04-04
8
445 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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 article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

729 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