Is it possible to take this aprroach with latest tooling 1.0.0-preview3-004056 #42
Comments
ok so I now see that this is not compatible with the latest tooling as Fixer.cs is built to look for .xproj which no longer exists My goal is to get feature code behind generating for a core 461 project using Vs Code But before I tried this package I had tried importing the specflow targets into the new csproj but this results in the error I posted above - sorry for the confusion Any ideas on how I could get this working - do you think this package has a very short lifetime now the new msbuild tooling is out or will it still be needed going forward? |
Hey Richard, thanks for reporting this. I believe you're correct in that this is related to the different tooling and lack of xproj in the new variant. A basic fix would be to switch xproj with csproj as I believe it's only used for it's file name. Finding out the test runner will also be different as Documentation will also need an overhaul. I will very likely have some time to look into this next week. How do we feel about abandoning |
I thought I would try and make that change but I cant get this to build -in preparation I ran error : RuntimeIdentifier must be set for .NETFramework executables even adding win7-x86 to csproj as runtime identifier didn't fix so a bit stuck If I can get it to build then I'll try and make the change and test As to whether another branch not sure - depends how long this project will survive I guess that now msbuild type project is out then it might not be long before specflow supports core and the msbuild targets could be used to generate the feature code behind files |
Great that you want to help with this! We have no Since I am on vacation I can't actually test this but I found an article on global.json while googling, perhaps that may help. Stajs have stated that this project isn't really supposed to stick around so you're right in that tooling branches may not be important. Old releases are still functioning fine for tooling that won't be updated so in my opinion we can probably stick to master. Stajs will decide that anyways. Looking forward to a pull request if you get it building, that would be so awesome! |
Thanks for the report. I haven't tried the latest tooling yet, but I'm happy to take a PR for it. I'm okay with not branching. People who don't have the latest tooling (including myself) can stick on the current version in the meantime. I probably won't have a chance to have a look until the tooling settles down a bit and we upgrade our work solutions, so if you want to have a crack at it yourself, feel free. Good point about the lack of The search for the |
I believe tools version The issue here will be that the implicit/convention based xml reduction introduced to try and placate I can't install the tooling to help out however. Installing 2017 will replace 2015's tooling and generally c*ck everything up for our projects. |
Hah, yes right you are. At some point back in the DNX days I had to use the VS2013 tools version. It looks like it was SpecFlow pre-v2.0 and since updating to v2.0 the comment wasn't changed/removed.
Yes. I don't want to force the addition of XML nodes in to the slimmed down implicit
I'm in the same boat ATM. |
I bumped into the same issue today, that it could not find |
Ok so I have the tooling and can build the Specflow.netcore project - but struggling to test I want to be able to run the command that the test projects run eg
After project migration this is traslated to
Currently thats using the nuget in my global packages folder/cache How do I get it to use my modified version - do I need to publish or package the Specflow.NetCore project and reference it somehow? |
Hey Richard, nice that you've gotten this far. My method, while imperfect, is to add a nuget local package source pointing at the build dir of the specflow.netcore project. Heres how to do that. It usually allows changing package version a lot for me as nuget keeps caching the version. If you guys have a better way I'm all ears. |
great I'll try that - I did publish the project which did create an rc7 version in my global nuget packages folder (for me thats at C:\Users\richa.nuget\packages\SpecFlow.NetCore\1.0.0-rc7) In the test project the new csproj as this entry
after migrating the proj json it was rc6 I updated to 7 after publishing my changes - I simply changed the references to ".xproj" to ".csproj" but when I build the test project I still get an error - indicating the old version is still used - if I delete the rc6 from my packages folder its restored in build - but I can't yet see a reference to rc6 anywhere I'll keep trying :) |
ok managed to get my code to use the local modified code by following this https://github.com/dotnet/cli/issues/5189 now as expected its complaining about not being able to find project.json so I'll try and work through the issues and update here |
So it looks like it was using project.json to determine which test runner was being used - this is now inferred from the package references it seems - http://www.natemcmaster.com/blog/2017/01/19/project-json-to-csproj/ |
So some success - after hardcoding GetProjectJsonTestRunner in AppConfig.cs I was able to build with VS2017 and VSCODE and have the specflow code behind files generate for at least the MSTest test project - I'll work on updating GetProjectJsonTestRunner to use the information in the new csproj file to determine the test framework Incidentally I did attempt to add in the generated elements to the new core csproj but Specflow.exe complained about some namespaces and version attributes on package references so it looks like we'll still need the fake csproj file for time being |
Sounds like some great progress! I've been away from the computer for a few days and will be for a few more but wanted to give some words of encouragement. Keep it up!
On the subject of global.json, I've been meaning to revisit the sample. I've used the global.json in other solutions to reference relative paths to include projects from outside the solution folder. This works for libraries, not sure about tools.
|
Ok I think I have this working see pr #43 If you want to test you'll need to pack the tool nupkg to a local folder and add a nuget.config to the sample projects as per https://github.com/dotnet/cli/issues/5189 |
That PR is merged now, but I'll leave this open until such time as I can get a NuGet package up. |
I can share a copy of nupkg via one drive or similar? |
Yes, please! |
No worries - have emailed link to your gmail address - hope thats ok
Richard
|
Thanks @richardjharding ❤️ , your work is up on NuGet now! |
Hi,
I'm trying to get Specflow working with VS Code and .Net core targeting net461 hoping you might have tried this already!
But I'm struggling to get the feature code behind .cs to generate?
I've added in the specflow targets but was not sure your approach could be adapted?
After importing the targets I get the error below - assuming this must be .net core mismatch?
The text was updated successfully, but these errors were encountered: