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

Does not work in vs2010? #140

Closed
LFDCC opened this issue Mar 18, 2019 · 6 comments
Closed

Does not work in vs2010? #140

LFDCC opened this issue Mar 18, 2019 · 6 comments

Comments

@LFDCC
Copy link

LFDCC commented Mar 18, 2019

The same code can be executed in vs2017

But take the code to vs2010 and it will not be executed

 public void Advise(MethodAdviceContext adviceContext)
        {
          //This code does not execute in vs2010
          //But in vs2017 there's no problem
        }

I wonder why

.net framework version 4.0

@picrap
Copy link
Member

picrap commented Mar 18, 2019

I'm not sure to understand: do you mean that Mr Advice does not weave assemblies in VS2010?

@LFDCC
Copy link
Author

LFDCC commented Mar 18, 2019

I did not use NuGet for some reason in VS2010, so I copied the DLL file directly into the VS2010 project directory for reference

I only copied one MrAdvice.dll file, I don't know if other files are missing

The MrAdvice. DLL file was downloaded by me with vs2017NuGet
The file directory is:packages\MrAdvice.2.8.2\lib\net40-client\MrAdvice.dll

My English is not good, the above content comes from the translation software, please forgive me

@LFDCC
Copy link
Author

LFDCC commented Mar 18, 2019

I had to use vs2010 because the company had some projects that were developed using vs2010 and are still under maintenance

@picrap
Copy link
Member

picrap commented Mar 18, 2019

You've missed the point: Mr Advice is a post-build weaver, which changes the assembly at build-time after the csc compiler has generated it. To achieve this, is inserts a task in the csproj. So if you want to do the same manually, you need to also add the build task in your csproj. If you have a VS2017 solution with a project working, you'll only need to copy the lines that were added to the csproj into your own project.

@LFDCC
Copy link
Author

LFDCC commented Mar 19, 2019

Oh, I ignored the csproj file
I had no problem trying to create an application project
But my project is a website project so there's no csproj file
So the configuration for the csproj file I don't know where to configure it

@picrap
Copy link
Member

picrap commented Mar 19, 2019

There may be some webproj or something like this.

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

No branches or pull requests

2 participants