You are browsing the archive for vs2010.

Usando o NUnit no Visual Studio 2010 em 3 passos

06/04/2010 in Hacks, Tips and Tricks

Se você tentou usar o NUnit para fazer teste unitário no Visual Studio 2010 e não conseguiu, pode ter ficado um pouco frustrado. Basta ler a mensagem que você vai perceber que o NUnit está tentando executar com uma versão do framework, diferente da usada pelo Visual Studio. A mensagem deve ser a seguinte:

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. You may be attempting to load an assembly build with a later version of the CLR than the version under which NUnit is currently running.

Você como bom programador, sabe que os fontes do NUnit estão disponíveis na internet, então sai correndo para recompila-lo no Visual Studio 2010. Mas tenha um pouco de calma, não é preciso nada disso. Basta seguir esses 3 passos:

1- Abra o arquivo .config do NUnit(está na mesma pasta do executável)

2- Dentro da tag <configuration> adicione o seguinte:
<startup>
<requiredRuntime version=”v4.0.20506″ />
</startup>

3- Dentro da tag <runtime> adicione:
<loadFromRemoteSources enabled=”true” />

Essa dica rápida pode lhe poupar alguns minutos.

 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up