简体   繁体   中英

Trying to add a project targeting .NET 3.5 to an existing project targeting .NET 4.0

I'm trying to integrate SharpVoice, which is targeting .NET 3.5 into an existing project targeting 4.0 Client Profile and I'm getting an error where it cannot find the namespace of SharpVoice.

The type or namespace name 'SharpVoice' could not be found

I read online that it could be because they are targeting different .NET versions, but when I try to change the SharpVoice target to .NET 4.0 Client Profile, I get a bunch of errors.

I also read that it is possible to integrate older versions of .NET in the newer ones, but it's not working.

Has anyone come across this problem and how did you fix it?

Found it.

SharpVoice references System.Web ( here , line 7) which is only available in the full framework. Client Profile doesn't allow that.

So, you have two choices. Either rework SharpVoice to no longer have a dependency on System.Web OR retarget your main application from Client Profile to instead use the full framework.

I think the second option is going to be far easier to do as removing System.Web appears to require a complete rewrite of that code. Note that changing your main app to use the full framework means you can leave the original google code in .net 3.5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM