TheMonkeyMan TheMonkeyMan - 2 months ago 28
ASP.NET (C#) Question

Apose.Total cannot find license file

I am currently using Aspose Total in one of my Libraries, When I import this library into an application it works well as my License is embedded.

However when I switch this library from debug to release it then gives an error when running the application saying 'Cannot find Aspose.Total.lic'

Is there anyone with experience with Aspose that might know the problem.

I include my Projbuild Set.

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B6C9F754-6764-4D2A-B1A4-C0047152BE33}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NitecCore</RootNamespace>
<AssemblyName>NitecCore</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;CSHARP30</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;CSHARP30; </DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>

Answer

Make sure you set lic.Embedded to true as in below code snippet:

Aspose.Pdf.License lic = new Aspose.Pdf.License(); 
lic.SetLicense("MergedAPI.Aspose.Total.Product.Family.lic");
lic.Embedded = true;

For reference, please check http://www.aspose.com/community/forums/thread/396532/aspose-pdf-cannot-find-the-embedded-license-file.aspx

Comments