aspnet / Testing

[Archived] Testing infrastructure, including support for xUnit.net and StyleCop. Project moved to https://github.com/aspnet/Extensions
66 stars 40 forks source link

aspnet.xunit: please fix casing of System.Xml dependency #60

Closed borgdylan closed 9 years ago

borgdylan commented 9 years ago

In https://github.com/aspnet/aspnet.xunit/blob/master/src/xunit.runner.kre/project.json#L9, it should be System.Xml and not System.XML. As things currently are all people on Linux/Mac cannot move from Xunit.KRunner to xunit.runner.kre

Eilon commented 9 years ago

@bricelam can you take a look? I thought that System.Xml was a weird one where the XML is supposed to be in all caps for the assembly name, but maybe not the package name? Because it's been that way for like over a decade? Or maybe I'm totally wrong... Also @davidfowl because I think he might also know something about this...

borgdylan commented 9 years ago

The file name is System.Xml.dll, as also displayed in MSDN library pages. With teh current casing i get "'splosions" when i run k test as shown below:

dylan@ubuntu-server:/var/www/Code/dylannet/vnext/dylan.NET.Tasks.Tests$ k test
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'Asp.Net,Version=v5.0':
   gac/System.XML 

Searched Locations:
  /var/www/Code/dylannet/vnext/{name}/project.json
  /home/dylan/.kpm/packages/{name}/{version}/{name}.nuspec
  /usr/lib/mono/4.5/{name}.dll
  /usr/lib/mono/4.5/Facades/{name}.dll

Try running 'kpm restore'.

  at Microsoft.Framework.Runtime.DefaultHost.GetEntryPoint (System.String applicationName) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
borgdylan commented 9 years ago

Also, remember System.Xml is not a real package for aspnet50 so we are talking about the GAC here.

borgdylan commented 9 years ago

Also in acse it helps, this is my project file:

{
  "version": "1.1.1.1",
    "code" : "*.dyl;*/*.dyl",
    "resources" : "*.resources",
    "language": {
        "name": "dylan.NET",
        "assembly": "dylan.NET.K",
        "projectReferenceProviderType": "dylan.NET.K.DNProjectReferenceProvider"
    },
  "dependencies": {
    "dylan.NET.K" : "",
    "xunit.runner.kre": "1.0.0-*",
    "dylan.NET.Tasks": ""
    },
  "compilationOptions": {
     "define": [],
     "optimize": "false"
  },
  "commands": {
        "test" : "xunit.runner.kre"
    },
  "frameworks": {
    "aspnet50": {
      "dependencies": {
      }
    }
  }
}
bricelam commented 9 years ago

Yeah, it's "System.XML.dll" on Windows. Except the GAC folder which is "System.Xml". The assembly name is also "System.Xml". @davidfowl We shouldn't be doing case-sensitive resolution at all...

davidfowl commented 9 years ago

Yes we should be. GAC references are a bit messy though.

juzzbott commented 9 years ago

So, what is the solution to get this working??

ajuckel commented 9 years ago

FWIW, I was getting:

System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'Asp.Net,Version=v5.0':
   framework/System.XML 

And editing ~/.k/packages/xunit.runner.utility/2.0.0-rc3-build2880/xunit.runner.utility.nuspec to replace

      <frameworkAssembly assemblyName="System.XML" targetFramework="ASP.Net5.0" />

with

      <frameworkAssembly assemblyName="System.Xml" targetFramework="ASP.Net5.0" />

(changing System.XML to System.Xml) fixed it for me. This is on a case-insensitive HFS+ macosx system, using mono 3.12 and KRE version 1.0.0-beta3-11030 of the mono runtime.

juzzbott commented 9 years ago

@ajuckel This fix worked for me also on Linux Mint 17. Thanks very much :)

bgeihsgt commented 9 years ago

FYI, I've submitted a pull request to xunit to fix this for good.

https://github.com/xunit/xunit/pull/336

Yantrio commented 9 years ago

Looks like that PR has been merged :) thanks @bgeihsgt