Skip to content
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

Hi! Sorry but , I have tha same error.... with version v1.0.0-alpha2-00365 #142

Open
romanreal89 opened this issue Dec 12, 2019 · 4 comments

Comments

@romanreal89
Copy link

Hi! Sorry but , I have tha same error.... with version v1.0.0-alpha2-00365
What can I do, to fix it?
Thank you!

PM> Generate-R4MVC -verbose
R4Mvc Generator Tool v1.0.0-alpha2-00365
Using: Visual Studio Professional 2017 - 15.9.28307.858
Project: E:\Projects\Git Vero.Tenders\Vero.TendersNetCore.Web\Vero.TendersNetCore.Web.csproj
Creating Workspace ...
Loading project ...
Compiling project ...
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: System.Management.Automation.RemoteException

Originally posted by @romanreal89 in #79 (comment)

@artiomchi
Copy link
Member

I'll make a patch this week so that it outputs any errors in powershell mode. There's most likely a project build or dependency error, which is why it's erroring out

@artiomchi
Copy link
Member

Hi @romanreal89

I just pushed a CI build (377) that should finally display proper error messages from the Powershell script. Hopefully this will shed some light on why it's failing to generate the files in your project.

Please note that this is a CI build, so you will have to pull it from the CI repo (see instructions here) and restart Visual Studio for the new version to be picked up. You'll see the version of the script that runs in the first line of the output, to make sure you're running the new version.

Please let me know if this solved this issue (the lack of proper errors from Powershell) so that I know to merge this to production

@romanreal89
Copy link
Author

romanreal89 commented Feb 18, 2020

Hi, @artiomchi !
Thank you, but I didn't see this build. Last build is 369.

@IanKemp
Copy link

IanKemp commented Jul 30, 2020

It's worse with the CI build (even less output, LOL):

PM> generate-r4mvc
  R4Mvc Generator Tool v1.0.0-ci-00377

Using: Visual Studio Enterprise 2019 - 16.6.30320.27
Project: <removed>.csproj

Creating Workspace ...
Loading project ...
Compiling project ...
Detected MVC version: 3.1.0.0

Processing controller ControllerName

Running the command manually (i.e. via .\R4Mvc.Tools.exe generate -p "<path\to\removed>.csproj") does yield output (see #154).

The reason is the $ErrorActionPreference = 'Stop' at the top of R4MVC.psm1. Stop means PS will immediately terminate the script on any error, which means the catch block is never entered (see https://stackoverflow.com/a/41518997/70345). I'd suggest just removing that $ErrorActionPreference = 'Stop' setting.

Alternatively, you can add -ErrorAction 'Continue' to the Write-Error in the catch block, but that output is far from useful:

Processing controller ControllerName
generate-r4mvc : 
At line:1 char:1
+ generate-r4mvc
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Generate-R4MVC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants