Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Solution not able to access network resources from network drive

Posted on 2011-03-08
4
Medium Priority
?
384 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Integration Management Part 2
Suggested Courses

886 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