Search Results

Search found 27056 results on 1083 pages for 'build mode'.

Page 20/1083 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How to build jars from IntelliJ properly?

    - by ripper234
    I have a project that contains a single module, and some dependencies. I'd like to create a jar, in a separate directory, that contains the compiled module. In addition, I'd like to have the dependencies present beside my module. No matter how I twist IntelliJ's "build jar" process, the output of my module appears empty (besides a META-INF file).

    Read the article

  • Specify build folder for iphone application

    - by Martin KS
    I've written an app that uses some of the user's camera roll images, and while it does so it stores them in the application root directory. The problem I have is that whenever I re-compile my application it changes the folder to which the application is installed. Is there any way I can specify which folder it should build to, so that any path information stored during it's last run will still be valid?

    Read the article

  • Is there any *good* HTML-mode for emacs?

    - by Carson Myers
    I love emacs, and I want to do my web-programming work in it, but I can't find a way to get it to edit HTML properly. I mean it's seriously awful. It will do HTML fine, but not PHP, javascript, etc. I tried getting html-helper-mode... I downloaded it, put it in /usr/local/share/emacs/site-lisp, and added it to my .emacs file: (autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t) (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) copied and pasted from some site (I don't know elisp). it just, doesn't highlight anything at all. I tried downloading a whole bunch of modes and using some other mode to string them together, to no avail. Emacs is so great in every other way--why can't it do the simple task of editing web pages? I mean, it's a pretty standard thing to do for editors these days. So, does anyone know how to do this?

    Read the article

  • Specify next boot to be into safe mode/WinRE via commandline?

    - by TMRW
    As the title says.I would like a script that tells windows that the next boot should be into safe mode or atleast that the "F8" menu should be presented next boot.Booting into WinRE(Launch startup repair...) is problably even more un-doable.I looked over bcdedit options but did'nt see anything like this.I know msconfig has an option for safe boot but it's gui only. Currently if i wan't to boot into safe mode or launch WinRE then i have to forcefully restart my pc first for those options to be presented during boot(F8 does not bring up the safe mode option under normal conditions). Im using Windows 7 x64.

    Read the article

  • Why doesn't disabling IE's 'Protected Mode' enable the dragging-and-dropping of addresses from the IE address bar into Notepad

    - by dumbledad
    IE's Protected Mode prevents one dragging the address from the IE address bar into other applications (for example Notepad). There's an informative article on MSDN about Allowing Drag and Drop Operations in your Application. If I uncheck Enable Protected Mode in IE's settings and restart IE I still cannot drag the address from the IE address bar into other Notepad. Why doesn't disabling IE's 'Protected Mode' enable the dragging-and-dropping of addresses from the IE address bar into Notepad? Is there a way to make that work without adding a registry entry for Notepad (following the instructions in the article I mentioned)? (N.B. This is actually part of me trying to work out how to get this address drag-and-drop working in Processing.)

    Read the article

  • Seamless Mode Not Working Correctly in Virtual Box

    - by Jeremy
    I run Ubuntu Desktop in a VirtualBox seamless mode, hosted on Windows 7. I recently upgraded from 11.10 to 12.04 and seamless mode no longer works correctly. I have re-installed guest extensions. The problem is that the Ubuntu desktop wallpaper is shown, effectively blocking the Windows desktop. I can bring Windows apps to the foreground, but as soon as I bring any Ubuntu window to the foreground, all the windows apps will disappear, hidden by the ubuntu desktop even if I activated an Ubuntu window in a different monitor. So, it is not very much different from full-screen mode at this time. I suspect if I could turn off the Ubuntu desktop or wallpaper this would be a sufficient workaround (this is basically what Seamless mode is) but that does not seem to be possible within Ubuntu itself. [Jeremy doesn't specify system config, but I can confirm I'm seeing this behavior in Win 7 64-bit with both 32-bit and 64-bit guests. Giovanni sees the same thing on his laptop running Vista Ultimate 64 bit after upgrading his 32-bit guest to 12.04 (forums.virtualbox.org p225407, requires logging in with your free Oracle account). I was using vbox 4.1.14r77440 and matching Guest Additions. I upgraded to 4.1.16-78094 vbox+additions. Still a problem. And I filed launchpad bug 999929 to see if I can get feedback from developers. – tbc0] Any other ideas?

    Read the article

  • Read-only filesystem Recovery Mode not working

    - by purbleguy
    I have seen other posts of this before, but they didn't help. In short, today I was trying to play Colobot on my Ubuntu Trusty computer, when I tried to access the directory the game was in by terminal, bash warned me that the disk was in a read-only state. I'm like, ok... So I reboot and go into recovery mode, there I do fsck, it finds errors, but apparently fails to fix them. At that point I was getting annoyed and searched the internet, once I found an answer I ran the grub and dpkg options in recovery mode, recovery mode said it was read/write, but when I boot in, I get the same thing, read-only. So I reboot into recovery mode, and tada! It's read-only again. I can't think of anything else to do, as the other people who had the same problems had them fixed by the steps I did. I got all my important files backed up to both a seperate partition and a seperate computer, so no worries there. I just need help getting this to work, as my computer might as well be a brick if I cant do f/a on it

    Read the article

  • Ubuntu 11.10 not starting in Graphical mode?

    - by iammilind
    I am in deep trouble. I am using Ubuntu 11.10 in dual boot mode with XP. Originally my touch pad was not working, (sometimes). To fix that, I installed something. After reboot my Ubuntu is not booting up!! I have several software pkgs already installed in past several weeks so reinstall of OS is my last resort. Can someone help me to get it rebooted in graphical mode? I had followed the procedure mentioned in this thread as well. With that link, somehow I am able to restart in text mode. But no luck after that. I am not being able to go back on graphical mode. The important outputs of lspci are following: 00.00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 0c) 00:02.0 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 0c) I am attaching few snapshots, for more details on hardware.

    Read the article

  • VB.NET generates properties in the release build

    - by dattebayo
    I have a form and i drag and drop a control in VB.NET. I have a line say, private WithEvents radioButton RadioButton Also, I have a handler like, private void click(.....) Handles radioButton.Click { ... } Now, When I build this is .NET 3.5 in release mode, and see the generated code in reflector tool, the code is something like, Private Overridable Property radioButton As RadioButton . . . <AccessedThroughProperty("radioButton")> _ Private _radioButton As RadioButton Can someone tell me what is going on here? And how do I avoid the generation of new properties and fields? -datte

    Read the article

  • Visual Studio not recognizing "BuildStep"

    - by AmbiguousX
    I'm trying to add an automatic post-build trigger to run NDepend after an automated team build in TFS 2010. NDepend's website provided code for integrating this capability, and so I have pasted their code into my .csproj file where they said for it to go, but I receive errors on the build. The errors refer to two of the three "BuildStep" tags I have in the code snippet. The following two snippets are giving me errors: <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Message="Running NDepend analysis"> <Output TaskParameter="Id" PropertyName="StepId" /> </BuildStep> and <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Id="$(StepId)" Status="Failed" /> However, this code snippet is NOT throwing up any problems: <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Id="$(StepId)" Status="Succeeded" /> I just don't understand why one works fine and a nearly identically laid out BuildStep tag does not. Is there something simple that I'm just overlooking? EDIT: Here is how it looks all together, if this makes a difference: <Target Name="NDepend" > <PropertyGroup> <NDPath>c:\tools\NDepend\NDepend.console.exe</NDPath> <NDProject>$(SolutionDir)MyProject.ndproj</NDProject> <NDOut>$(TargetDir)NDepend</NDOut> <NDIn>$(TargetDir)</NDIn> </PropertyGroup> <Exec Command='"$(NDPath)" "$(NDProject)" /OutDir "$(NDOut)" /InDirs "$(NDIn)"'/> </Target> <Target Name="AfterBuild"> <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Message="Running NDepend analysis"> <Output TaskParameter="Id" PropertyName="StepId" /> </BuildStep> <PropertyGroup> <NDPath>c:\tools\NDepend\NDepend.console.exe</NDPath> <NDProject>$(SolutionRoot)\Main\src\MyProject.ndproj</NDProject> <NDOut>$(BinariesRoot)\NDepend</NDOut> <NDIn>$(BinariesRoot)\Release</NDIn> </PropertyGroup> <Exec Command='$(NDPath) "$(NDProject)" /OutDir "$(NDOut)" /InDirs "$(NDIn)"'/> <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Id="$(StepId)" Status="Succeeded" /> <OnError ExecuteTargets="MarkBuildStepAsFailed" /> </Target> <Target Name="MarkBuildStepAsFailed"> <BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" Id="$(StepId)" Status="Failed" /> </Target> EDIT: Added a bounty because I really need to get this going for my team. Thank you in advance!

    Read the article

  • Présentation de Gradle, le nouveau outil de build incontournable s'appuyant sur le langage Groovy, p

    Gradle est un nouveau système de build, dit de troisième génération offrant aux projets un véritable langage de build pour la construction (souvent complexe) des produits. Voici un article sur Gradle, le nouvel outil de build incontournable http://zenika.developpez.com/article.../build/gradle/ Si le sujet vous intéresse et que vous êtes sur Paris, Evènement gratuit : Conférence Gradle/Artifactory à Paris le jeudi 6 mai 2010 en soirée chez Zenika...

    Read the article

  • CruiseControl.Net Build Publisher - Only publish compiled files

    - by FlySwat
    While setting up CruiseControl, I added a buildpublisher block to the publisher tasks: <buildpublisher> <sourceDir>C:\MyBuild\</sourceDir> <publishDir>C:\MyBuildPublished\</publishDir> <alwaysPublish>false</alwaysPublish> </buildpublisher> This works, but it copies the entire file contents of the build, I only want to copy the DLL's and .aspx pages, I don't need the source code to get published. Does anyone know of a way to filter this, or do I need to setup a task to run a RoboCopy script instead?

    Read the article

  • Help -- trying to build Apache ODE source code with Buildr

    - by Moon13
    Hi, i am trying to build APACHE ODE source code with Buildr using Ruby. I installed ruby and installed Buildr with it, but when i run the command rake package on the root of APACHE ODE source code it gives me this error C:\workspace2\APACHE_ODE_1.Xrake package --trace (in C:/workspace2/APACHE_ODE_1.X) rake aborted! uninitialized constant Gem::Requirement::OP_RE The gems i have installed C:\workspace2\APACHE_ODE_1.Xgem list * LOCAL GEMS * Antwrap (0.7.0) archive-tar-minitar (0.5.2) builder (2.1.2) buildr (1.3.5) highline (1.5.1) hoe (2.3.3) net-sftp (2.0.2) net-ssh (2.0.15) rake (0.8.7) rjb (1.1.6) rspec (1.2.8) rubyforge (1.0.5) rubygems-update (1.3.6) rubyzip (0.9.1) xml-simple (1.0.12)

    Read the article

  • Build Issue with multi module project

    - by vijay.shad
    Hi, I have a multi module web project. Four modules of the project are packaged as jar and added as dependency to the fifth module, which is packaged as war. When it is time to deploy the application i just run package on the war project and my war is created with all the dependencies. Now there is a problem. One of the my module have heavy changes. Now when i created war for my projects these changes was not reflected in the output war file(the jar in lib folder of war has still the old code). Can you please point the things i am missing from the release process? Why the old code is being packaged with the war? Can you please point some good resource for real file build process using maven? Regards, Vijay

    Read the article

  • Team build of Web Projects generates App_web_xxxx.dll files and TFSBuild.Proj Script

    - by Steve Johnson
    Hi all, I have a web application that has some non-web projects as well. When using Web Deployment, a single assembly is generated for all the aspx.vb files. When using Team Build (TS 2008), a lot number App_Web_xxx.dll file(s) are generated instead of a single assembly. How can i solve this problem and change the TFSBuild.proj file so that it can generate a single Web Assembly instead of a lot number of assemblies. Please help. Thanks Edit: I guess thats because the MERGE operation is not occurring like it used to happen for Web Deployment Project in my solution. How can i enable MERGE of App_web_*.dll files into a single Web.dll assembly file and delete the satellite assemblies? Here is my code from TFSBuild.proj file: (MY web project is in Release|.NET Config and all other projects within the solution are in Release|Any CPU) true .\Debug true true Web true false .\Release true true Web true Please tell me what are the corrections i need to do.,

    Read the article

  • Using Kate with Simple Build Tool (SBT)

    - by Stefan
    Hello I am working with the Kate editor based on the lack of other good tools for Scala development, I am also using IntelliJ however it still has some bugs, and are slow enough to make me impatient. I have just startet using both Kate and SBT, and in that regard I have a little challenge I hope there is an answer for out there on "The Internet". I am using the standard "Build plugin" in Kate and has changed the commands from make to sbt. This works fine, and I am also getting a error report when the sbt fails during compile time. However I really wish to know if it is possible to integrate the compile errors into Kate such that it would be shown under "Errors and Warnings" instead of just in the output tab, where I have to do a manual search for the compile errors. Im guessing that it has something to do with the format of the output, if that is the case maybe it is "just" a smaller adjustment I need to make to the parsing language.

    Read the article

  • Build Environment setup - Using .net, java, hudson, and ruby - Could really use a critique

    - by Jeff D
    I'm trying to figure out the best way to stitch together a fast, repeatable, unbreakable build process for the following environment. I've got a plan for how to do it, but I'd really appreciate a critique. (I'd also appreciate some sample code, but more on that later) Ecosystem - Logical: Website - asp.net MVC 2, .net 3.5, Visual Studio 2010. IIS 6, Facebook iframe application application. This website/facebook app uses a few services. An internal search api, an internal read/write api, facebook, and an IP geolocation service. More details on these below Internal search api - .net, restful, built using old school .ashx handlers. The api uses lucene, and a sql server database behind the scenes. My project won't touch the lucene code, but does potentially touch the database and the web services. internal read/write api - java, restful, running on Tomcat Facebook web services A mocking site that emulates the internal read/write api, and parts of the facebook api Hudson - Runs unit tests on checkin, and creates some installers that behave inconsistently. Ecosystem - Physical: All of these machines can talk to one another, except for Hudson. Hudson can't see any of the target machines. So code must be pulled, rather than pushed. (Security thing) 1. Web Server - Holds the website, and the read/write api. (The api itself writes to a replicated sql server environment). 2. Search Server - Houses the search api. 3. Hudson Server - Does not have permissions to push to any environment. They have to pull. 4. Lucene Server 5. Database Server Problem I've been trying to set this site up to run in a stress environment, but the number of setup steps, the amount of time it takes to update a component, the black-box nature of the current installers, and the time it takes to generate data into the test system is absolutely destroying my productivity. I tweak one setting, have to redeploy, restart in a certain order, resetup some of the settings, and rebuild test data. Errors result in headscratching, and then basically starting over. Very bad. This problem is complicated further by my stress testing. I need to be able to turn on and off different external components, so that I can effectively determine the scalability of each piece. I've got strategies in place for how to do that for each dependency, but it further complicates my setup strategy, because now each component has 2 options. A mock version, or a real version. Configurations everywhere must be updated accordingly. Goals Fast - I want to drop this from a 20 minute exercise when things go perfectly, to a 3 minute one Stupid simple - I want to tell the environment what to do with as few commands as possible, and not have to remember how to stitch the environments together Repeatable - I want the script to be idempotent. Kind of a corollary to the Stupid Simple thing. The Plan So Far Here's what I've come up with so far, and what I've come looking for feedback on: Use VisualStudio's new web.config transformations to permit easily altering configs based on envrionment. This solution isn't really sufficient though. I will leave web.config set up to let the site run locally, but when deploying elsewhere, I have as many as 6 different possible outputs for the stress environment alone (because of the mocks of the various dependencies), let alone the settings for prod, QA, and dev. Each of these would then require it's own setup, or a setup that would then post-process the configs. So I'm currently leaning toward just having the dev version, and a version that converts key configuration values into a ruby string interpolation syntax. ({#VAR_NAME} kinda thing) Create a ruby script for each server that is essentially a bootstrapping script. That is to say, it will do nothing but load the ruby code that does the 'real' work from hudson/subversion, so that the script's functionality can evolve with the application, making it easy to build the site at any point in time by reference the appropriate version of the script. So in a nutshell, this script loads another script, and runs it. The 'real' ruby script will then accept commandline parameters that describe how the environment should look. From there, 1 configuration file can be used, and ruby will download the current installers, run them, post-process the configs, restart IIS/Tomcat, and kick off any data setup code that is needed. So that's it. I'm in a real time crunch to get this site stress-tested, so any feedback that you think could abbreviate the time this might take would be appreciated. That includes a shameless request for sample ruby code. I've not gotten too much further than puts "Hello World". :-) Just guidance would be helpful. Is this something that Rake would be useful for? How would you recommend I write tests for this animal? (I use interfaces and automocking frameworks to mock out things like http requests in .net. With ducktyping, it seems that this might be easier, but I don't know how to tell my code to use a fake duck in test, but a real one in practice) Thanks all. Sorry for such such a long-winded, open-ended question.

    Read the article

  • TFS 2008 Build Script

    - by pm_2
    In TFS 2008, I am trying to modify a build script (TFSBuild.proj). I get the following warning: The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'TeamProject' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. Which is correct, The element PropertyGroup does indeed have a child called TeamProject. I’m making an assumption that this is caused because of the following line: <Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> The Xml Namespace doesn’t appear to exist as far as I can tell, although it looks like a standard one. Please can anyone tell me if this is a standard XML namespace, how or where I can view its contents and whether the warning that I am seeing may be caused by it?

    Read the article

  • TFS build problem: missing assembly in test output folder

    - by Herman
    Hi all, I am trying to integrate unit test cases with a TFS build in our new solution. I've include the following configuration line in my TFSBuild.proj <ItemGroup> <TestContainer Include="$(OutDir)\%2aTest.dll" /> </ItemGroup> Which I think is the correct configuration since I only have 1 test project. However, when I do this, some dll is missing in the output folder of the test case, hence failing most of my test case. Has anyone run into this problem before? Thanks!

    Read the article

  • Build Machine Configuration Recommendations?

    - by IPX Ares
    We have a new build machine to start using for our programming team. We are still trying to figure out how we want to organize everything to get the best configuration for building EXEs and DLLs. We are using VB6 and VB.Net 2005, and VSS2005. We were thinking of making working folders set for each project, release and support tickets. Does anyone have experience with a similar set up? What were your likes/dislikes? Any recommendations (New VSS IDs, folder configuration, setting working folder, updating/building files)?

    Read the article

  • CI Build status output alternatives

    - by Brett Rigby
    We currently use Cradiator to display the status of our continuous integration (CI) builds from CruseControl.net, on a 42" Samsung television on display high-up in our IT department. Cradiator is a great starting place, but we're getting to the point whereby we're having lots of projects on there and it's starting to get a bit 'full'. What I'd like to know is, what do you use to display your build statuses? Custom software? Off the shelf stuff? etc. Alternatively, I'm looking for ideas on how we improve on Cradiator.

    Read the article

  • Hudson build fails when a user logs out of RDP session

    - by sjohnston
    We are using Hudson to build mixed C++/Java projects with an Ant script. It is running in Tomcat 6, on a Win XP virtual machine. I have noticed recently that when a user logs off the machine (from a remote desktop session), builds that are currently running tend to suddenly fail without an error message. Has anyone encountered anything similar or have an idea what might be causing this effect? I can post additional information about our setup if needed, I'm just not sure what's relevant in this case.

    Read the article

  • Solution: Testing Web Services with MSTest on Team Build

    - by Martin Hinshelwood
    Guess what. About 20 minutes after I fixed the build, Allan broke it again! Update: 4th March 2010 – After having huge problems getting this working I read Billy Wang’s post which showed me the light. The problem here is that even though the test passes locally it will not during an Automated Build. When you send your tests to the build server it does not understand that you want to spin up the web site and run tests against that! When you run the test in Visual Studio it spins up the web site anyway, but would you expect your test to pass if you told the website not to spin up? Of course not. So, when you send the code to the build server you need to tell it what to spin up. First, the best way to get the parameters you need is to right click on the method you want to test and select “Create Unit Test”. This will detect wither you are running in IIS or ASP.NET Development Server or None, and create the relevant tags. Figure: Right clicking on “SaveDefaultProjectFile” will produce a context menu with “Create Unit tests…” on it. If you use this option it will AutoDetect most of the Attributes that are required. /// <summary> ///A test for SSW.SQLDeploy.SilverlightUI.Web.Services.IProfileService.SaveDefaultProjectFile ///</summary> // TODO: Ensure that the UrlToTest attribute specifies a URL to an ASP.NET page (for example, // http://.../Default.aspx). This is necessary for the unit test to be executed on the web server, // whether you are testing a page, web service, or a WCF service. [TestMethod()] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web", "/")] [UrlToTest("http://localhost:3100/")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] public void SaveDefaultProjectFileTest() { IProfileService target = new ProfileService(); // TODO: Initialize to an appropriate value string strComputerName = string.Empty; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = target.SaveDefaultProjectFile(strComputerName); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); } Figure: Auto created code that shows the attributes required to run correctly in IIS or in this case ASP.NET Development Server If you are a purist and don’t like creating unit tests like this then you just need to add the three attributes manually. HostType – This attribute specified what host to use. Its an extensibility point, so you could write your own. Or you could just use “ASP.NET”. UrlToTest – This specifies the start URL. For most tests it does not matter which page you call, as long as it is a valid page otherwise your test may not run on the server, but may pass anyway. AspNetDevelopmentServerHost – This is a nasty one, it is only used if you are using ASP.NET Development Host and is unnecessary if you are using IIS. This sets the host settings and the first value MUST be the physical path to the root of your web application. OK, so all that was rubbish and I could not get anything working using the MSDN documentation. Google provided very little help until I ran into Billy Wang’s post  and I heard that heavenly music that all developers hear when understanding dawns that what they have been doing up until now is just plain stupid. I am sure that the above will work when I am doing Web Unit Tests, but there is a much easier way when doing web services. You need to add the AspNetDevelopmentServer attribute to your code. This will tell MSTest to spin up an ASP.NET Development server to host the service. Specify the path to the web application you want to use. [AspNetDevelopmentServer("WebApp1", "D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: This AspNetDevelopmentServer will make sure that the specified web application is launched. Now we can run the test and have it pass, but if the dynamically assigned ASP.NET Development server port changes what happens to the details in your app.config that was generated when creating a reference to the web service? Well, it would be wrong and the test would fail. This is where Billy’s helper method comes in. Once you have created an instance of your service call, and it has loaded the config, but before you make any calls to it you need to go in and dynamically set the Endpoint address to the same address as your dynamically hosted Web Application. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Reflection; using System.ServiceModel.Description; using System.ServiceModel; namespace SSW.SQLDeploy.Test { class WcfWebServiceHelper { public static bool TryUrlRedirection(object client, TestContext context, string identifier) { bool result = true; try { PropertyInfo property = client.GetType().GetProperty("Endpoint"); string webServer = context.Properties[string.Format("AspNetDevelopmentServer.{0}", identifier)].ToString(); Uri webServerUri = new Uri(webServer); ServiceEndpoint endpoint = (ServiceEndpoint)property.GetValue(client, null); EndpointAddressBuilder builder = new EndpointAddressBuilder(endpoint.Address); builder.Uri = new Uri(endpoint.Address.Uri.OriginalString.Replace(endpoint.Address.Uri.Authority, webServerUri.Authority)); endpoint.Address = builder.ToEndpointAddress(); } catch (Exception e) { context.WriteLine(e.Message); result = false; } return result; } } } Figure: This fixes a problem with the URL in your web.config not being the same as the dynamically hosted ASP.NET Development server port. We can now add a call to this method after we created the Proxy object and change the Endpoint for the Service to the correct one. This process is wrapped in an assert as if it fails there is no point in continuing. [AspNetDevelopmentServer("WebApp1", D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target, TestContext, "WebApp1")); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: Editing the Endpoint from the app.config on the fly to match the dynamically hosted ASP.NET Development Server URL and port is now easy. As you can imagine AspNetDevelopmentServer poses some problems of you have multiple developers. What are the chances of everyone using the same location to store the source? What about if you are using a build server, how do you tell MSTest where to look for the files? To the rescue is a property called" “%PathToWebRoot%” which is always right on the build server. It will always point to your build drop folder for your solutions web sites. Which will be “\\tfs.ssw.com.au\BuildDrop\[BuildName]\Debug\_PrecompiledWeb\” or whatever your build drop location is. So lets change the code above to add this. [AspNetDevelopmentServer("WebApp1", "%PathToWebRoot%\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target, TestContext, "WebApp1")); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: Adding %PathToWebRoot% to the AspNetDevelopmentServer path makes it work everywhere. Now we have another problem… this will ONLY run on the build server and will fail locally as %PathToWebRoot%’s default value is “C:\Users\[profile]\Documents\Visual Studio 2010\Projects”. Well this sucks… How do we get the test to run on any build server and any developer laptop. Open “Tools | Options | Test Tools | Test Execution” in Visual Studio and you will see a field called “Web application root directory”. This is where you override that default above. Figure: You can override the default website location for tests. In my case I would put in “D:\Workspaces\SSW\SSW\SqlDeploy\DEV\Main” and all the developers working with this branch would put in the folder that they have mapped. Can you see a problem? What is I create a “$/SSW/SqlDeploy/DEV/34567” branch from Main and I want to run tests in there. Well… I would have to change the value above. This is not ideal, but as you can put your projects anywhere on a computer, it has to be done. Conclusion Although this looks convoluted and complicated there are real problems being solved here that mean that you have a test ANYWHERE solution. Any build server, any Developer workstation. Resources: http://billwg.blogspot.com/2009/06/testing-wcf-web-services.html http://tough-to-find.blogspot.com/2008/04/testing-asmx-web-services-in-visual.html http://msdn.microsoft.com/en-us/library/ms243399(VS.100).aspx http://blogs.msdn.com/dscruggs/archive/2008/09/29/web-tests-unit-tests-the-asp-net-development-server-and-code-coverage.aspx http://www.5z5.com/News/?543f8bc8b36b174f Technorati Tags: VS2010,MSTest,Team Build 2010,Team Build,Visual Studio,Visual Studio 2010,Visual Studio ALM,Team Test,Team Test 2010

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >