Using .Net SDK Tools in pre- and postbuild events in VS

6. October 2011

Sometimes you need to call gacutil or other SDK tools from build-events and in order to do this, they need to be added to the path.

Not exactly rocket science, but I always forget the macro and for future reference the following line will do the trick:

call "$(DevEnvDir)..\..\VC\vcvarsall.bat" x86


Christian Staerk  

Visual Studio 2010, .Net

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

6. July 2010

Im building some custom map helpers for BizTalk 2010, and when i tried to add the to the gac I got the following error message :

 

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded !

The reason being that with BizTalk 2010 you have to use the new .net 4.0 Gac util. Time update all those scripts ;)

 

Fore more details, of where to find it etc. se this post : http://community.dotnetwork.it/Excentric/archive/2010/06/18/this-assembly-is-built-by-a-runtime-newer-than-the.aspx

 

Btw, you might need to download the win7 SDK tool too ;)

 


Michael Høtoft  

.Net, BizTalk Server, Visual Studio 2010 ,

power commands for Visual Studio 2010

17. June 2010

great tool to make your life in vst2010 better ;)

http://visualstudiogallery.msdn.microsoft.com/en-us/e5f41ad9-4edc-4912-bca3-91147db95b99

 


Michael Høtoft  

Visual Studio 2010

Writing Unit Tests with SPMetal in VST2010 RC for SharePoint 2010

12. April 2010

 

I really hope today’s release of VST2010 will solve this issue. In my current setup, VST2010 RC and SharePoint 2010 beta its not really possible building Unit Test against SPMetal.

I have a simple DomainModel and DomainModelTest project.

The DomainModel project contains the SPMetal autogenerated MySystem.cs file.

The DomainModelTest project contains a unit test to test the DomainModel as expected.

 

The test :

[TestMethod()]
       public void DataleverandoerTest()
       {
           ResourceManager resMgr = new ResourceManager("DomainModelTest.TestSettings", Assembly.GetExecutingAssembly());

           string requestUrl = resMgr.GetString("weburl"); // TODO: Initialize to an appropriate value
           IUSystemDataContext target = new IUSystemDataContext(requestUrl); // TODO: Initialize to an appropriate value
           EntityList<Item> actual;
           actual = target.Dataleverandoer;
           Assert.Inconclusive("Verify the correctness of this test method.");

 

The immidiate error :

Test method DomainModelTest.IUSystemDataContextTest.DataleverandoerTest threw exception:
System.IO.FileNotFoundException:

 

Srini Sistla's Blog

 

Srini Sistla found out that this happens because the test project is running under .net Framework 4.0. Thanks Srini it could have had me blocked for hours ;)

http://codename-srini.blogspot.com/2010/03/error-systemiofilenotfoundexception-was.html

 

The simple solution: #FAIL

Change the framework to 3.5… FAIL.  IT CANT BE DONE IN VST2010 RC !! And its a well know bug : https://connect.microsoft.com/VisualStudio/feedback/details/483939/unable-to-change-target-framework-version-on-unit-test-projects

 

Today is 2010 release day. I really hope it’s fixed and will get back to Y’all. Otherwise its back to the good old NUnit or similar.


Michael Høtoft  

Sharepoint Server, Visual Studio 2010