开发者

why would a .cs file not see updates to an included dll file

I have a dll containing classes to access data in SQL (a sort of ORM system) included in my .cs page with a using statement. For some reason the dll (with definition for a new field) isn't seen by the cs co开发者_StackOverflowde, though I've uploaded the new dll in bin. It won't see my new field in the dll's helper classes (now compiled into the dll).

Is there a way to troubleshoot the dll, or the cs to tell why this won't see the class I updated and rebuilt? The class works fine locally and on another server, but on my prod server, it bombs.

This is using Sitefinity 3.7 with a Subsonic/Substage module if that sheds some light on it.


If you are using Visual Studio, verify 2 things, first: try deleting csproj.user and .suo files (visual studio will recreate them)

The second thing is the version of the framework your project is running, and the version of the framework the dll was compiled in.

If your project is using .NET 4.0 but the DLL was built using 2.0 or similar you may not be able to use it, you can add it, but it wont be loaded.


This sounds so familiar... have you check to see if there is another dll on the path that gets resolved? Dynamic-Link Library Search Order


Make sure that your dll was not registered on the production service in the GAC.

How to extract an assembly from the GAC?


Perhaps you have a local copy of the DLL in your project and the DLL that gets updated is elsewhere.


I tend to think the dll you build is 32 bit (X86) dll. where as you are trying to consume it from project that targets "Any CPU".

Is your production server a 64 bit ? If answer is yes, goto project properties => Build tab (of your cs code's project which is not understanding the dll) and set the Platform target as X86.


If the updated DLL has a different version number, you may need to update the Project Reference to it by deleting and re-adding a reference to the DLL in the bin folder.

If the project generating the DLL is present in the same solution, you may have an issue in creating a file reference (may not be updated) instead of a project reference (will be updated).


fuslog.exe is a great tool when troubleshooting assembly (dll) binding issues.

http://msdn.microsoft.com/en-us/library/e74a18c4.aspx


Another .net developer helped me figure this out. I had a rogue ToString() in there where there should have been a cast to string, allowing nulls. My dll was okay after all. Thanks everyone for your suggestions, I learned a lot.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜