14 Nisan 2010 Çarşamba

Muhammedi Genclik

Hayırlı işlerin hepsine Bismillah

Şerlerin hepsine Euzû billah

Her korkuda Lâ ilahe illallah...

Her hüzün ve kederde Maşaallah

Her günaha Estağfirullah

Her musibette İnna lillah

Her nimette Elhamdûlillah

Her bolluğa Eş-şükrü lillah

Her şaşılacak şey için Sübhanallah

Her darlık için Hasbiyallah

Her kaza ve kadere Tevekkeltü al-A...llah...

Her itaat ve isyanda Lâ havle vela kuvvete illa billah

deriz.

13 Nisan 2010 Salı

Postsharp 1.5 vs 2010 integration


http://www.besystems.hu/blog/post/Using-PostSharp-with-Visual-Studio-2010-Beta.aspx


 


There is a possible memory leak in PostSharp execution and the "PostSharUseCommandLine=True" forces PostSharp to use command-line utility. "A new process will be created for each invocation, so there can be surely be no memory leak in this time."


The second was that the PostSharp compiler does not work with .NET 4 assemblies at this moment (PostSharp 1.5). So you will downgrade your PostSharp enabled projects .NET version to 3.5. :(


 


The modified C# project file:








  1. <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  

  2.   <PropertyGroup>  

  3.     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>  

  4.     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>  

  5.     <ProductVersion>10.0.20506</ProductVersion>  

  6.     <SchemaVersion>2.0</SchemaVersion>  

  7.     <ProjectGuid>{AE544EFB-2842-4A41-BF6C-3038D2046E90}</ProjectGuid>  

  8.     <OutputType>Library</OutputType>  

  9.     <AppDesignerFolder>Properties</AppDesignerFolder>  

  10.     <RootNamespace>Bes.Core</RootNamespace>  

  11.     <AssemblyName>Bes.Core</AssemblyName>  

  12.     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>  

  13. ...  

  14.   <PropertyGroup>  

  15.     <PostSharpUseCommandLine>True</PostSharpUseCommandLine>  

  16.     <DontImportPostSharp>True</DontImportPostSharp>  

  17.     <PostSharpDirectory>..\..\libs\PostSharp</PostSharpDirectory>  

  18.   </PropertyGroup>  

  19.   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />  

  20.   <Import Project="$(PostSharpDirectory)\PostSharp-1.5.targets" />  

Sharepoint 2010 Windows Form Application Reference

Sharepoint 2010 için oluşturulan Windows Form Application'lara Sharepoint dll'i referans verildiğinde uygulama compile ettiğinde referansı görmüyo ise dikkat edilecek noktalar;

 

1- Windows Form uygulamasının X86 olmaması

2- Windows Form uygulamasının Framework 3.5 olması önemlidir

Sharepoint 2010 Code Behind Assembly

Sharepoint'te custom oluşturulan sayfa yada user controllerin code behind dosyaları aynı projede olabileceği gibi farklı bir dll 'den de gelebilir.

Page'in aspx'inde yada user control'ün ascx'inde code behind tanımlası yapılırken

CodeBehind="XXX.aspx.cs" Inherits="XX Kod Dosyası" tanımlamasında XX Kod Dosyası


1- aynı projede ise aspx yada ascx'in en üst satırına


<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>


tanımlaması yapmak yeterli olacaktır.


2- farklı class lib de ise


   1. Create the Code-Behind Assembly
   2. Deploy the Code-Behind Assembly
   3. Reference the Assembly in your SharePoint Page
   4. Tell SharePoint that it is safe to use the assembly


(Kaynak: http://johanolivier.blogspot.com/2010/01/sharepoint-code-behind-tutorial.html)