3

i have created google analytics application in visual studio 2012 , but my project is in 3.5 version . can we do google analytics in 3.5 version framework?

krishna mohan
  • 437
  • 1
  • 4
  • 18
  • possible duplicate of [How to reference .NET 4.0 assembly within .NET 3.5 projects](http://stackoverflow.com/questions/1609894/how-to-reference-net-4-0-assembly-within-net-3-5-projects) – Ramesh Rajendran Mar 13 '15 at 05:14

3 Answers3

3

No you can't. An assembly compiled against .NET 4.5 can be loaded only by the CLR 4.5. On the other hand the CLR 4.5 can load assemblies compiled against .NET 3.5.

See more discussions with other versions

How to reference .NET 4.0 assembly within .NET 3.5 projects

Can you use a .NET 4.0 dll in a 3.5 project?

Community
  • 1
  • 1
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
1

The simple answer is you can't. Since Windows Server 2003 cannot run .NET 4.5, the first step would be to recompile the 4.5 application to target framework version 4 instead. This may be simple or may be next to impossible depending on what features of 4.5 you are using.

The next problem is integrating the assemblies, which is not possible in the direction you require (3.5->4.0). See also How to reference .NET 4.0 assembly within .NET 3.5 projects .

One solution would be to upgrade the 3.5 project to reference framework 4.0. Another solution would be to create a wrapper in 4.0 that references and calls into the 3.5 project. You can set up callbacks and use the wrapper as a rudimentary controller to marshal between the two assemblies. In any case this is not going to be "simple".


Note you may also have a little fun getting .NET 4 running if you're using IIS 6. Refer to http://johan.driessen.se/posts/getting-an-asp.net-4-application-to-work-on-iis6 for more details, and according to KB article http://support.microsoft.com/kb/328360/, you will need to run iisext to enable the .NET framework 4.0 isapi.dll:

cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

Alternatively, upgrade to Server 2008r2 or Server 2012.

Community
  • 1
  • 1
lc.
  • 113,939
  • 20
  • 158
  • 187
0

Define Do Google analytics?

You can send data to Google Analytics using the measurement protocol it is a simple http post or get.

You can request data from the Google Analytics API v3 with .net 3.5 using the Core reporting API it is done all though web HTTP Get calls so it can be done with .net 3.5 I have done it. Main hurdle is have to handle all of the Oauth2 yourself. Tricky again I have done it.

You can NOT users Google's .Net client library for Google Analytics API it currently supports .Net 4.0 and 4.5.

Hope this helps.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449