Skip to content

NUnitLite package always installs both Program.cs and Program.vb #1428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ChrisMaddock opened this issue Apr 20, 2016 · 12 comments · Fixed by #3952
Closed

NUnitLite package always installs both Program.cs and Program.vb #1428

ChrisMaddock opened this issue Apr 20, 2016 · 12 comments · Fixed by #3952
Assignees
Milestone

Comments

@ChrisMaddock
Copy link
Member

ChrisMaddock commented Apr 20, 2016

The NUnitLite package has an install script which looks like it should be delete either of these files if they do not match the project type. It doesn't seem to be working. Haven't really looked in to why, yet.

@ChrisMaddock ChrisMaddock added this to the Backlog milestone Apr 20, 2016
@ChrisMaddock ChrisMaddock changed the title NUnit Lite always installs both Program.cs and Program.vb NUnitLite package always installs both Program.cs and Program.vb Apr 20, 2016
@CharliePoole
Copy link
Member

I can verify that it worked at one time.

@CharliePoole CharliePoole removed this from the Backlog milestone Jul 25, 2016
@ChrisMaddock ChrisMaddock self-assigned this Sep 20, 2016
@ChrisMaddock ChrisMaddock removed their assignment Oct 24, 2016
@ChrisMaddock
Copy link
Member Author

Update: I believe install.ps1 is no longer ran at all for PackageReference or project.json NuGet scenarios.

We probably need to find a different solution for this functionality.

dotnet/ef6#189 (comment)

@ChrisMaddock
Copy link
Member Author

The contentfiles can be specified with a target language in the directory - although I don't know how backwards compatible that is. Given this has been 'not working' since this time last year though, maybe not worth worrying about too much. 😄

https://docs.microsoft.com/en-us/nuget/schema/nuspec#package-folder-structure

@ChrisMaddock ChrisMaddock self-assigned this Mar 28, 2017
@CharliePoole
Copy link
Member

@ChrisMaddock From the docs, it's not clear whether installing the package would cause the files to be copied only to the corresponding project type. Experiment if you like. 😄

We also have had some discussion that indicates this causes problems when the package is installed in CI, if the user already provided their own entry point, so we may want to rethink this. Maybe it should just be provided as a sample or not provided at all.

@rprouse
Copy link
Member

rprouse commented Mar 29, 2017

We can drop the install.ps1 and just put the files in Content and they will be copied in. If they already exist in a user's project, they will be prompted if they want to overwrite when they install or upgrade the package. It is never copied in a restore.

@ChrisMaddock ChrisMaddock removed their assignment Mar 29, 2017
@CharliePoole
Copy link
Member

@rprouse The problem isn't with overwriting a file but with having two files in the project that define Main. Whoever works on this should ensure that it works in that situation.

@ChrisMaddock ChrisMaddock self-assigned this Sep 1, 2017
@ChrisMaddock
Copy link
Member Author

This is another one that causes me regular pain, and I want to get round to fixing.

There's some debate here as if we want to install the file at all. Personally - I'd like to fix the current (intended) behaviour, and leave any further improvements to a separate issue.

Any objections to that?

@CharliePoole
Copy link
Member

I don't think it matters which way we go - either dropping both or using the correct language.

@jnm2
Copy link
Contributor

jnm2 commented Sep 2, 2017

@ChrisMaddock sounds good.

@mikkelbu
Copy link
Member

I looks like install.ps1 is not supported anymore - see NuGet/Home#6330 and NuGet/Home#5963 - but perhaps we can use Init.ps1 instead - see https://stackoverflow.com/a/40932008 - but that will be executed every time the solution is opened.

@CharliePoole
Copy link
Member

Why not just remove the install script and both files? Neither file has been installed for about three years. I just installed nunitlite in a project yesterday. I typed in a one-line main and that was it.

@mikkelbu
Copy link
Member

mikkelbu commented Oct 2, 2021

I agree with Charlie. I've supplied a PR and I'll update https://docs.nunit.org/articles/nunit/running-tests/NUnitLite-Runner.html when this is merged.

@mikkelbu mikkelbu added this to the 4.0 milestone Dec 9, 2021
mikkelbu added a commit to nunit/docs that referenced this issue Dec 9, 2021
This functionality have not worked for years, and have now been removed in future versions by
nunit/nunit#1428
SeanKilleen pushed a commit to nunit/docs that referenced this issue Dec 9, 2021
This functionality have not worked for years, and have now been removed in future versions by
nunit/nunit#1428
github-actions bot pushed a commit to nunit/docs that referenced this issue Dec 9, 2021
This functionality have not worked for years, and have now been removed in future versions by
nunit/nunit#1428 aba5b1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants