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

Changeset added bin\debug for loading WebApiProxy.Tasks.dll #85

Open
onionhammer opened this issue Feb 19, 2016 · 6 comments · Fixed by #88
Open

Changeset added bin\debug for loading WebApiProxy.Tasks.dll #85

onionhammer opened this issue Feb 19, 2016 · 6 comments · Fixed by #88
Labels

Comments

@onionhammer
Copy link
Collaborator

On WebApiProxy-Generate-CSharp command:

Changeset

Add-Type -Path (Join-Path $projectPath "bin\Debug\WebApiProxy.Tasks.dll")

This can lead to errors as WebApiProxy.Tasks.dll isn't built/added to the bin/debug folder

\bin\Debug\WebApiProxy.Tasks.dll' because it does not exist.
@onionhammer
Copy link
Collaborator Author

Now I'm getting this

PM> WebApiProxy-Generate-CSharp
Cannot bind argument to parameter 'Path' because it is null.
    + CategoryInfo          : InvalidData: (:) [Add-Type], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddTypeCommand
    + PSComputerName        : localhost

Unable to find type [WebApiProxy.Tasks.Models.Configuration]. Make sure that the assembly that contains this type is loaded.
    + CategoryInfo          : InvalidOperation: (WebApiProxy.Tasks.Models.Configuration:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound
    + PSComputerName        : localhost

Cannot find type [WebApiProxy.Tasks.Infrastructure.CSharpGenerator]: verify that the assembly containing this type is loaded.
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
    + PSComputerName        : localhost

Generating proxy code...
You cannot call a method on a null-valued expression.
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
    + PSComputerName        : localhost

@onionhammer onionhammer reopened this Mar 1, 2016
@faniereynders
Copy link
Member

What version of Powershell & VS are you using?

@onionhammer
Copy link
Collaborator Author

Visual Studio 2015 on windows 8.1?

@faniereynders
Copy link
Member

Weird I cannot seem to reproduce this. Just tested it on your config as well and it works. I did however make changes to the package file to include the libs on the correct build configuration inside the project

@DigitalDel
Copy link

@onionhammer did you ever resolve this? I've now started getting this error as well despite it previously working fine?

@DigitalDel
Copy link

DigitalDel commented Sep 9, 2016

Problem identified.

This will occur if you have multiple projects in your VS Solution. I have 3 projects in my Solution:

  • API
  • Class Library
  • MVC Application

The MVC app is the one on which i am trying to generate the proxy code however when i edited the WebApiProxyCSharp.psm1 file to print out the project path it is returning the path for my API project not the path of the MVC project the package is installed on and which has the references to WebApiProxy.Core and WebApiProxy.Tasks.

Anyone any advice on how to fix? I did try adding references to WebApiProxy.Core and WebApiProxy.Tasks to the other projects in my solution and but WebApiProxyCSharp.psm1 uses the project path to identify the config and output paths which are obviously in the API project not the MVC project where the package is installed.

The only solution i can think of at the moment is to install the package on the API project, generate the proxy code there and manually copy the generated file to the correct project but it doesn't make it particularly friendly to work with.

onionhammer added a commit to onionhammer/WebApiProxy that referenced this issue May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants