一个.cs文件可以覆盖一个编译好的Asp.net站点的bin文件中的代码吗?

时间:2021-07-21 08:10:17

I have take over a old asp.net website and there is no Visual Studio Project for it. If i want to change some functionality, is there a way to put in a .cs file overriding the logic in the bin file?

我已经接管了一个旧的asp.net网站,没有Visual Studio项目。如果我想要更改某些功能,是否有一种方法可以放入.cs文件以覆盖bin文件中的逻辑?

2 个解决方案

#1


3  

I am not aware of any other solution but one.

我不知道其他的解决办法,只有一个。

You can decompile the whole dll, create a new project and attach all classes there. Then recompile and replace an old dll with a new one.

您可以对整个dll进行反编译,创建一个新项目,并在那里附加所有的类。然后重新编译并将一个旧dll替换为新的dll。

You may need to decompile the whole web site, as it is likely there will be some dependencies to other dlls.

您可能需要对整个web站点进行反编译,因为可能会有一些对其他dll的依赖。

#2


0  

For anyone who stumbles across this question, I'd like to suggest an alternate approach. Take a look at Fody. Fody is an IL weaving tool which allows you to weave in changes to existing .dll compiled files. Here is a Basic Fody Addin Project. You'll notice Fody would allow you to inject or 'weave' code changes into the IL without a decompile.

对于任何遇到这个问题的人,我想建议另一种方法。看看Fody。Fody是一个IL编织工具,它允许您编织对现有.dll编译文件的更改。这是一个基本的Fody插件项目。你会注意到Fody会允许你在没有反编译的情况下注入或“weave”代码。

#1


3  

I am not aware of any other solution but one.

我不知道其他的解决办法,只有一个。

You can decompile the whole dll, create a new project and attach all classes there. Then recompile and replace an old dll with a new one.

您可以对整个dll进行反编译,创建一个新项目,并在那里附加所有的类。然后重新编译并将一个旧dll替换为新的dll。

You may need to decompile the whole web site, as it is likely there will be some dependencies to other dlls.

您可能需要对整个web站点进行反编译,因为可能会有一些对其他dll的依赖。

#2


0  

For anyone who stumbles across this question, I'd like to suggest an alternate approach. Take a look at Fody. Fody is an IL weaving tool which allows you to weave in changes to existing .dll compiled files. Here is a Basic Fody Addin Project. You'll notice Fody would allow you to inject or 'weave' code changes into the IL without a decompile.

对于任何遇到这个问题的人,我想建议另一种方法。看看Fody。Fody是一个IL编织工具,它允许您编织对现有.dll编译文件的更改。这是一个基本的Fody插件项目。你会注意到Fody会允许你在没有反编译的情况下注入或“weave”代码。