Problem with Beta 3.0 ASMX tests

Jul 15, 2009 at 9:23 PM

Hi there.  I'm following the lab, Exercise 7, in order to create a test for an ASMX web service.  I've downloaded and installed the Beta 3.0.  I'm running VS.NET 2008 SP1.

One problem I noticed in the lab is that on Step 15, you need to include a reference to System.Runtime.Serialization.

However, my main issue is that I've followed all the instructions in the exercise and when I compile the test project, I receive the following error:

Error 2 Unable to copy file "..\GuideDataWebServiceLoad\bin\Debug\GuideDataWebServiceLoad.dll" to "bin\Debug\GuideDataWebServiceLoad.dll". The process cannot access the file 'bin\Debug\GuideDataWebServiceLoad.dll' because it is being used by another process. 

The GUideDataWebServiceLoad is the class library I created to an ASMX web service not located on my workstation.

It appears that the class library DLL, once I've added a reference, cannot be overwritten in the TestProject's bin/Debug folder.  What can be done to get around this?  Should I create the class library outside of the test project's solution and add it that way?

Thanks!

Todd

Jul 15, 2009 at 9:30 PM

I've discovered that I can change the "Copy Local" parameter of the class library reference to "False" and the project will compile.  However, I do receive the following:

------ Rebuild All started: Project: GuideDataWebServiceLoad, Configuration: Debug Any CPU ------

C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\GuideDataWebServiceLoad.dll /target:library Properties\AssemblyInfo.cs proxy.cs

Compile complete -- 0 errors, 0 warnings

GuideDataWebServiceLoad -> C:\Visual Studio Projects\TestProject1\GuideDataWebServiceLoad\bin\Debug\GuideDataWebServiceLoad.dll

------ Rebuild All started: Project: TestProject1, Configuration: Debug Any CPU ------

c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3061: Unable to delete file "C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll". Access to the path 'C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll' is denied.

C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Visual Studio Projects\TestProject1\GuideDataWebServiceLoad\bin\Debug\GuideDataWebServiceLoad.dll" /reference:"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\TestProject1.dll /target:library Properties\AssemblyInfo.cs WCFTest1.cs WCFTest1.Custom.cs

Compile complete -- 0 errors, 0 warnings

TestProject1 -> C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\TestProject1.dll

c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3061: Unable to delete file "C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll". Access to the path 'C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll' is denied.

c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3061: Unable to delete file "C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll". Access to the path 'C:\Visual Studio Projects\TestProject1\TestProject1\bin\Debug\GuideDataWebServiceLoad.dll' is denied.

Done building project "TestProject1.csproj".

Should changing the Copy Local parameter to False make a difference?

Jul 15, 2009 at 10:01 PM

OK - I've discovered a problem with Exercise 7 and why I was receiving the above error.

Step 16 should read:

Add the generated file app.config to the test project.

Step 24 should read:

Use the Add button to find the assembly that contains the contract interface, in this case choose the class library created for this solution. Please note that this will add a reference to your test project. Click Finish.

Once I did this and compiled/debugged my test project, my test project ran correctly.  Therefore, the "Copy Local" parameter change is not necessary.

Coordinator
Jul 16, 2009 at 8:30 AM

Thanks for the feedback. I have amended the lab document for System.Runtime.Serialization and will include the updated document in a future release.

The problem you have been having is a known problem with the WCF Load Test wizard. The problem is that the wizard loads your assembly, which then remains loaded even after you have stopped using the wizard. As the wizard is run by Visual Studio that means Visual Studio is locking the assembly file, which means you can't build it again. Unfortunately the workaround is to exit and restart Visual Studio, or use the command line tool. If you are sure the referenced assembly is not going to change you could make a copy and then reference that when running the wizard.

I need to bump this problem up the priority list as it has been reported by quite a few people.