Solved

Solution not able to access network resources from network drive

Posted on 2011-03-08
4
374 Views
Last Modified: 2012-05-11
Hi,

I'm running VS 2010 Ultimate on a Win7 Professional machine. The policy of my employer is that everyone does there work on the provided network drives.

The problem that I am having is that if I write an application that uses an external source such as Active Directory or an external web service I get varying error messages varying from " dead network " (I cant remember the full error) to " The Network Path was not found ".

However when I copy my solution to the local drive or a USB drive the project works fine. To add to the confusion any linqtosql or edm projects work fine.

I am an administrator of my local machine and I am running visual studio as an administrator. I've tried using caspol to set Exclusive entry’s for fully trusting the network drive.

When I run: caspol -rsg  for the exe location on

C: the Enterprise and User are fully trusted and for Machine Zone MyComputer is fully trusted

for P (network) I have. 1.  All code: Nothing
   1.2.  Zone - Intranet: LocalIntranet
      1.2.1.  All code: Same site Web
      1.2.2.  All code: Same directory FileIO - 'Read, PathDiscovery'
   1.6.  Url - P:\*: FullTrust (Exclusive)
   1.7.  Url - \\domain\staff\drives\ME\*: FullTrust (Exclusive)
   1.8.  Url - file://\\domain\staff\drives\ME\*: FullTrust (Exclusive)
   1.9.  Url - file://P:\*: FullTrust (Exclusive)

I am possibly missing the caspol command to set the appropriate permission on the network drive.   The main thing that is confusing me is the inconsistency of it. It's very frustrating, especially as the error messages don't seem to completely relate to the problem at hand.

I hope someone can help point out where I am going wrong.

Kind Regards,

David
0
Comment
Question by:Neogeta
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35083780
Security changed quite a bit in 4.0, and I am still trying to get my head around the changes...

Security Changes in the .NET Framework 4
http://msdn.microsoft.com/en-us/library/dd233103.aspx

Starting with the .NET Framework 4, the common language runtime (CLR) is moving away from providing security policy for computers. Historically, the .NET Framework has provided code access security (CAS) policy as a mechanism to tightly control and configure the capabilities of managed code. Although CAS policy is powerful, it can be complicated and restrictive. Furthermore, CAS policy does not apply to native applications, so its security guarantees are limited. System administrators should look to operating system-level solutions such as Windows Software Restriction Policies (SRP) or AppLocker on Windows 7 and Windows Server 2008 R2 as a replacement for CAS policy. SRP and AppLocker policies provide simple trust mechanisms that apply to both managed and native code. As a security policy solution, SRP and AppLocker are simpler and provide better security guarantees than CAS.
0
 
LVL 1

Author Comment

by:Neogeta
ID: 35127143
Thanks for that bit of information.  I have set SRP to allow unrestricted access to the network path to no effect.

I've had to install VS2005 to update a project. I'm now getting the same error despite that it worked fine in winXP. Now on win7 Its not working and im getting same/simlar error messages that I've been getting on VS2010.
In light of this I've tried running VS2005 in XP compatability Mode and still getting the same error.

The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)

The error itself I think is a red hearing as the SQL Server is available, you can preview data through VS2005/2010 and SQLManagementStudio. Yet As soon as I move my projects to C: they work.

I'm at a complete loss on where the problem is.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 35129496
Do you have a strong-named assembly?  If not, you should try to strong-name the assembly, and apply trust that way.
0
 
LVL 1

Author Closing Comment

by:Neogeta
ID: 36179582
I've been having to live with this problem, my employer keeps dumping more work on me and I;ve not had an oppertunity to follow up.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now