4

Im using ScriptSharp to create a RIA app. Works nice besides some oddities.

However finding and fixing problems using Firebug isn't really convinient.

Since scriptsharp also delivers a Dll I was hoping to use a separate testproject using Nunit to test some parts of my code.

Issue that arises is that the generated dll references mscorlib 0.7 resulting in conflict with mscorlib 4 in the test project.

A simple solution is to create a second plain C# project and copy codefiles around. But maintaining 2 projects with the same code base...

Curious if there is another way to do this. Anybody?

EDIT: Solution as proposed by Christian Dalager works.

Small thing is that ScriptSharp has redefined System.Diagnostics in mscorlib. No more Debug.Assert/Writeline. But there is almost no more need for it now.

1 Answer 1

3

You might try using assembly binding redirects

You would put something like this in the app.config on your testproject. Havent tested this particular configuration, so you will need to adjust it.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
     <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.7.0.0" newVersion="4.0.0.0"/>
     </dependentAssembly>
    </assemblyBinding>
</runtime> 
Sign up to request clarification or add additional context in comments.

4 Comments

It seems to do the trick! Resharper isn't aware of it and keeps complaining but that's a minor issue. Is there also a way to redirect namespaces in a same way?
I think you need to code your way out of that one.. Can't you just tell resharper to ignore that one somehow?
Resharper is easy to shut up.
@lboshuizen, if you think this answer actually answered your question, you should accept it by clicking on the green tick mark.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.