+: Splendid tutorial format, especially for broaching novel content like that in WF4.
-: I could not intall tutorials through VSIX Installer -- apparently the patch for VS2010 did not carry through to VS2012. The 260 character file name limitation might still be at issue.
This is a good basic overview. Note, if you get errors related to InitializeComponent, make sure the project's target framework setting is set to .NET 4.0.
Thanks for the great tutorial! Unfortunately I've run into an issue and I can't move past it with the existing code sample as it's written...
In Exercise 6, Task 1 you introduce the use of TextContext in the ShouldRunActivityOnBackgroundThread method. When I put that code into my test class, Visual Studio underlines WriteLine in red and the error is "Cannot access non-static method "WriteLine" in static context." If I try to build I get this exception for each of the two lines it's on:
An object reference is required for the non-static field, method, or property 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.WriteLine(string, params object[])' C:\Projects\HelloWorkflow1\HelloWorkflow.Tests\SayHelloTest.cs 64 13 HelloWorkflow.Tests
I've tried Googling the proper way of calling this, but every example I find gives me the same syntax. Not sure what I'm missing here, but the only way I can move past it is to change it to Console.WriteLine. Any idea how I can fix this?
Thanks!
I had the same issue initially - you need to flesh out your own TestContext for that unit test. The easiest way to do that may be to just selected the test project in the solution, go to the "Test" menu at the top, select "New Test", and finally choose the "Unit Test" template. It will create the outline code for your TestContext in the new test file, which you can then paste in to your existing unit test file.
adding this to class seems to work, or at least it lets the solution compile. Now, to find what this writes to.
private TestContext _testContext;
public TestContext TestContext
{
get { return _testContext; }
set { _testContext = value; }
}
got this from:
http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/51caf5f5-bd62-4b1e-bf48-059498744125/
This bit of code (above) is missing from the included code/guidance. If you watch the video very closely for Exercise 6 about 3m30s in you will see it flash by.
I am getting build errors 1 & 2 both are same subsequent code in SayHelloTest.cs/ShouldRunActivityOnBackgroundThread. I copied the code, so dont know what could have gone wrong...
TestContext.WriteLine("Test thread is {0}", Thread.CurrentThread.ManagedThreadId);
TestContext.WriteLine("Activity thread is {0}", activityThread);
Error 1 An object reference is required for the non-static field, method, or property 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.WriteLine(string, params object[])' C:\myData\SandBox\HelloWorkflow1\HelloWorkflow.Tests\SayHelloTest.cs 37 13 HelloWorkflow.Tests
Anyone know whats wrong?
Thanks,
Gaja
I get the following error, any ideas on how to resolve it?
ICAP Error (icap_error)
An error occurred while performing an ICAP operation: Internal error: 79 An unexpected error occurred.
There could be a network problem, the ICAP service may be misconfigured, or the ICAP server may have reported an error.
Thanks,
Gaja
I have tried a couple times to install the labs but I get an error. The log file tells me that the path is too long. This path apparently seems to points to the folder where installer extracts files. I don't know how to change the path or fix the error. Please help.
Thanks.
kr
Sorry you are experiencing trouble with this. I'm not sure how to help except to say that we have similar content in the Visual Studio 2010 training kit (Introduction to Workflow lab). In that kit the delivery mechanism is different so you won't have this problem. You can either download the kit or do the online version at http://msdn.microsoft.com/en-us/VS2010TrainingCourse_IntroToWF
It appears there is a conflict with the nice descriptive folder names and limitations of the system.IO objects in .Net.
Install Error : System.IO.PathTooLongException: C:\Documents and Settings\[myName]\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Lab - Intro To WF4\1.0\Templates\Projects\Workflow\Hands On Lab\Exercises\LabComplete.zip: HelloWorkflow.Tests/HelloWorkflow.Tests.vstemplate
I also have the ZIP file version, but it is not clear where the files should be extracted to.