Visual Studio build fails: unable to copy exe

Update: A sample project reproducing this bug can be found here at Microsoft Connect. I have also tested and verified that the solution given in the accepted answer below works on that sample project. If this solution doesn't work for you, you are probably having a different issue (which belongs in a separate question). This is a question asked before, both here on Stack Overflow and othe

Visual Studio生成失败:无法复制EXE

更新:重现此错误的示例项目可以在此处找到Microsoft Connect。 我还测试并验证了下面接受的答案中给出的解决方案适用于该示例项目。 如果这个解决方案不适合你,你可能会遇到一个不同的问题(属于一个单独的问题)。 这是一个在Stack Overflow和其他地方都提到过的问题,但是我发现的这些建议都没有帮助我,所以我只需要尝试提出一个新问题。 情景:我有一个简单的Windows窗体应用程序(C#,.NET 4.0,Visual Studio 201

Visual Studio 2010 C# Run/Debug on Remote Machine

Please excuse my ignorance, I am mainly a Java developer and a bit unfamiliar with Visual Studio and the details of some of the debugging process. I am creating an application (WPF and Console) in C# that is being developed on my workstation but I need to run/debug the application on another remote machine. Is there a way that I can just hit "Debug" from Visual Studio 2010 and have i

Visual Studio 2010 C#在远程计算机上运行/调试

请原谅我的无知,我主要是一位Java开发人员,对Visual Studio有点不熟悉,也有些调试过程的细节。 我正在C#中创建一个正在我的工作站上开发的应用程序(WPF和控制台),但我需要在另一个远程计算机上运行/调试该应用程序。 有没有一种方法可以从Visual Studio 2010中点击“调试”并让它模拟目标机器的运行? 我需要这样做是因为远程计算机上的本地文件目录访问。 我研究过远程调试,但我认为我处于错误的轨道上,因为远程调

Running unit tests in VS2012 from network shares / within VM

Running Visual Studio 2012 with Update 3 and ReSharper 7.1.3 running in a VMWare machine with Windows 7 64bit. When working with projects on network shares or mapped drives I found that the assemblies are not being loaded due to the change in CAS policies with .NET 4.0 System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the ass

在VS2012中从网络共享/ VM内运行单元测试

在带有Windows 7 64位的VMWare机器上运行Update 3和ReSharper 7.1.3的Visual Studio 2012。 当处理网络共享或映射驱动器上的项目时,我发现由于.NET 4.0中CAS策略的变化,程序集未被加载 System.NotSupportedException:尝试从网络位置加载程序集,该程序集会导致程序集在以前版本的.NET Framework中被沙箱化。 此版本的.NET Framework默认情况下不启用CAS策略,因此此加载可能很危险。 如果此加载不是为了装配沙盒,请启

How to access Network Share from Raspberry Pi running IoT Core in UWP app

I have ac# UWP app that I'm intending to run on a Raspberry PI with Windows 10 IoT Core. The problem I have is when I try to connect to a UNC share to copy some files. The network is just a home network with local user credentials, share is on another computer on the same network. When running the app locally I can just use await StorageFolder.GetFolderFromPathAsync(@"\sharefolder&q

如何在UWP应用程序中使用运行IoT Core的Raspberry Pi访问网络共享

我有一个ac#UWP应用程序,我打算在Windows 10 IoT Core上运行Raspberry PI。 我遇到的问题是当我尝试连接到UNC共享以复制某些文件时。 网络只是具有本地用户凭据的家庭网络,共享位于同一网络上的另一台计算机上。 在本地运行应用程序时,我可以使用await StorageFolder.GetFolderFromPathAsync(@"\sharefolder"); 连接到共享,这工作正常,我假设这是因为我使用的凭据保存在本地计算机上。 当在RPi上运行时,

managed way of accessing UNC path with authenticaton

Using .net >= 4, is there a way to access UNC path with authentication (without using Win32 API)? Basically for a given folder path, i want to get its directory listing and load file content. I found a 6 year old solution with Win32 API Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials Is there a modern solution? The .NET way of doing this is through impersi

通过身份验证访问UNC路径

使用.net> = 4,有没有办法通过身份验证访问UNC路径(不使用Win32 API)? 基本上对于给定的文件夹路径,我想获取其目录列表并加载文件内容。 我发现一个具有6年历史的Win32 API解决方案通过凭证从远程,不受信任的域访问共享文件(UNC)是否有现代化的解决方案? .NET这样做的方式是通过impersionation。 以下是一些可帮助您入门的链接: 你如何在.NET中进行模拟? http://blogs.msdn.com/b/shawnfa/archive/2005/

Accessing an NFS share from a Windows service

I have a Windows service that can't access an NFS share on a UNIX box. I can't access the share with the UNC path, so I have to have it mounted. I have a console application that can see the drive and runs fine, but when I deploy my Windows service, it can't see the drive. I have the drive mounted as my local user as well as the administrator. I've tried mounting a drive fr

从Windows服务访问NFS共享

我有一个Windows服务无法访问UNIX框上的NFS share 。 我无法访问与UNC路径的共享,所以我必须安装它。 我有一个控制台应用程序,可以看到驱动器并运行正常,但是当我部署Windows服务时,它无法看到驱动器。 我将驱动器安装为本地用户以及管理员。 我已经尝试通过使用"Process.Start(mBatchFilePath);"从我的应用程序挂载一个驱动器"Process.Start(mBatchFilePath);" ,但那也没用。 我以本地用户

Search and get file information from remote workstation on a Windows domain

I need to query the file system of a remote workstation on a Windows domain. The program should search the remote file system for the existence of specific filenames and file paths. For example, assume I want to find out whether “c:program filesmozillafirefox.exe” or “c:program fileschromechrome.exe” exists on any workstation in a domain of 10,000 machines. What options I know: 1) Only C# cod

在Windows域中从远程工作站搜索并获取文件信息

我需要查询Windows域上远程工作站的文件系统。 程序应该搜索远程文件系统中是否存在特定的文件名和文件路径。 例如,假设我想知道在10,000台计算机的域中的任何工作站上是否存在“c: program files mozilla firefox.exe”或“c: program files chrome chrome.exe”。 我知道哪些选项:1)只有Windows模拟使用WIN32 API和使用UNC路径和管理员共享访问的C#代码,例如 ServerName C $ FolderName(我不确定我们需要从域服

Accessing network share via Process.Start(path) using network credential

I am using this Impersonator class to impersonate a domain account to access a network share like so: using(new Impersonartor(username, domain, password)) { //Code Here } Copying the file from the network share works okay: using(new Impersonartor(username, domain, password)) { CopyAll(uncPath, localPath) } However, using Process.Start to view the UNC share in Explorer throws a "Logon fa

使用网络凭证通过Process.Start(路径)访问网络共享

我使用这个Impersonator类来模拟一个域帐户来访问网络共享,如下所示: using(new Impersonartor(username, domain, password)) { //Code Here } 从网络共享中复制文件可以正常工作: using(new Impersonartor(username, domain, password)) { CopyAll(uncPath, localPath) } 但是,使用Process.Start在资源管理器中查看UNC共享会引发“登录失败:未知用户名或密码错误”: using(new Impersonartor(username, domain, passwo

C# Programmatic Remote Folder / File Authentication In Non

I need to be able to programmatically authenticate when trying to read and write files on a remote computer in a non-domain environment. When you type a command into the Windows RUN prompt that is similar to \targetComputerC$targetFolder or \targetComputeradmin$, where the targetComputer is NOT on a domain, you will be prompted to enter a username and password. Once you enter the username and

非C#中的C#编程远程文件夹/文件身份验证

我需要在尝试在非域环境中的远程计算机上读取和写入文件时以编程方式进行身份验证。 当您在类似于\ targetComputer C $ targetFolder或\ targetComputer admin $(其中targetComputer不在域中)的Windows RUN提示符中输入命令时,系统会提示您输入用户名和密码。 一旦你输入用户名和密码,你就可以完全访问远程文件夹。 如何在C#中以编程方式完成此身份验证? 我试过了.. - 人员,但似乎只能在域环境中工作。 --

Running Visual Studio 2010 UI tests not on Ultimate

I have built a test with UI automation using Visual Studio 2010 Ultimate. I would like to run the test on computers that have other editions of Visual Studio 2010 installed, not Ultimate. However when I try to use mstesttestcontainer:tests.dll (the dll file of the test with the debug library) there was error that it was missing one of the test files. Is there a way to run a UI test on a compu

运行Visual Studio 2010 UI测试不在Ultimate上

我使用Visual Studio 2010 Ultimate构建了一个使用UI自动化的测试。 我想在安装了其他版本的Visual Studio 2010的计算机上运行测试,而不是Ultimate。 但是,当我尝试使用mstest testcontainer:tests.dll(测试的dll文件与调试库)有错误,它是缺少其中一个测试文件。 有没有一种方法可以在没有Ultimate版本的计算机上运行UI测试? 谢谢。 编码UI测试只能在VS Ultimate和VS Premium上运行 。 以下是显示哪些VS版本支