Solved

Solution not able to access network resources from network drive

Posted on 2011-03-08
4
378 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

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!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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