views:

620

answers:

4

I just installed VS2010 RC and launched the FullDuplex sample from NServiceBus 2.0.0.1145 and it ran fine. I then changed the target framework of each project in the solution to ".NET Framework 4", recompiled and launched in the debugger and received the following exception:

System.InvalidOperationException was unhandled Message=No endpoint configuration found in scanned assemblies. This usually happens when NServiceBus fails to load your assembly contaning IConfigureThisEndpoint. Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationTypeScanned path: C:\Development\Personal\ThirdParty\NServiceBus\samples\FullDuplex\MyClient\bin\Debug\ Source=NServiceBus.Host StackTrace: at NServiceBus.Host.Program.ValidateEndpoints(IEnumerable`1 endpointConfigurationTypes) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 189 at NServiceBus.Host.Program.GetEndpointConfigurationType() in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 171 at NServiceBus.Host.Program.Main(String[] args) in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Program.cs:line 32 InnerException:

+1  A: 

The error is actually saying everything :)

The generic host cannot find an endpoint configuration, probably because it fails to dynamically discover and load your .NET 4 assemblies.

You might need to check out the NServiceBus source code and built it against .NET 4 yourself for it to work.

mookid8000
You have to get latest ilmerge and pass v4 as the targetframework to it.
Andreas
A: 

Andreas, can you please provide a bit more detail?

I'm having the same problem, and cannot figure out how to fix it.

Many thanks, Roy

Roy
A: 

I was never able to get this completely resolved. I first had to convert all of the NSB projects to set the target framework to 4.0. I then upgraded to the latest ilmerge and added the necessary arguments for it to the build script. Next I had to update NAnt and NUnit configuration files to also work with 4.0. I was finally able to get a successful build and ilmerge but now I get an error related to the framework version of TopShelf when executing the upgraded FullDuplex sample using the newly compiled libraries.

I'm assuming I'll have to get newer TopShelf binaries or get the source and build it myself against the 4.0 framework but I haven't been able to look at it in the last week.

Andreas, are there any plans to update the NSB project itself to the 4.0 framework in the near future?

Jim
+2  A: 

You have to provide the correct supported runtime version in the NServiceBus.Host.exe.config

for example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="EndpointConfigurationTypeScanned" value="d:\w\ServiceBusTest\"/>
  </appSettings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
menty
This worked for me, thanks!
Scott Ferguson