August 11, 2012

The tag does not exist in XML namespace


Error:
The tag 'XXX' does not exist in XML namespace 'clr-namespace:YYY;assembly=YYY'. Line zz Position zz.


Solution:
I know, it's really weird, but the solution is simple. Just change
FROM:
xmlns:ZZZ="clr-namespace:YYY;assembly=YYY"
TO:
xmlns:ZZZ="clr-namespace:YYY;assembly="
leave empty value for assembly=

August 10, 2012

Lunch Condition


Problems: 
- Install .Net Framework in Setup Project ...
- Adding Dot Net Framework to the Setup Project in ...
- Install .NET Framework with Visual Studio .NET ...
- Create setup project that includes .Net Framework 3.5 ...
- How to attach .Net framework 4.0 client profile to my setup project?
- Setup project wants to install .NET 4
- How to include .NET framework redistributable in Visual Studio setup ....
- Setup project: where .net framework 4.0 is
- Add Prerequisites of .NET Framework in Visual Studio Setup Project ...
- .Net 2.0 or 3.5 Setup Project Requires .Net Framework version 4.0

Solutions:
Windows Installer 3.1 (With Local Prerequisite)
Name: Windows Installer 3.1
Condition: VersionMsi >= "3.1"
InstallUrl: WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe
Message: Windows Installer 3.1 is required to run this setup

Windows Installer 3.1
Name: Windows Installer 3.1
Condition: VersionMsi >= "3.1"
InstallUrl: go.microsoft.com/fwlink/?LinkId=42467
Message: Windows Installer 3.1 is required to run this setup

Windows Installer 4.5 (With Local Prerequisite)
Name: Windows Installer 4.5
Condition: VersionMsi >= "4.05"
InstallUrl: WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe
Message: Windows Installer 4.5 is required to run this setup

Windows Installer 4.5
Name: Windows Installer 4.5
Condition: VersionMsi >= "4.05"
InstallUrl: http://go.microsoft.com/fwlink/?LinkId=120486
Message: Windows Installer 4.5 is required to run this setup

.NET Framework (With Local Prerequisite)
Name: .NET Framework
InstallUrl: DotNetFX40Client\dotNetFx40_Client_x86_x64.exe
Version: .NET Framework 4 Client Profile
Message: [VSDNETMSG]

PS: '.NET Framework' condition is a automatic added condition after add a .Net Project to Setup Project

August 08, 2012

Unable to update the EntitySet

Error:
Unable to update the EntitySet 'XYZ' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.

Solution:
Just add Primary Key for your Table in Database or DataModel (edmx file).

August 07, 2012

Change Entity Framework ConnectionString‎

Problem: 
- Dynamically change Entity Framework Connection String‎
- How to change the connection string in the EntityFramework ...
- How should I edit an Entity Framework connection string ...
- change db name in connection string at runtime in Entity Framework
- Cannot change the connectionstring with Entity Framework 4.1 code ...
- Entity Framework - how can I change connection string to be relative?
- Entity Framework Connection String Trouble - Stack Overflow

Solution:
Just add System.Configuration.dll to Refrences of your Project and then use of this code
ConfigurationManager.ConnectionStrings[0].ConnectionString = blah blah blah
ConfigurationManager.ConnectionStrings["XYZEntities"].ConnectionString = blah blah blah

Error in Solution:
Error: 
The configuration is read only.
Correction: 

var Configuration = ConfigurationManager.ConnectionStrings["amaBoxOfficeEntities"];
typeof(ConfigurationElement).GetField("_bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(Configuration, false);
Configuration.ConnectionString = blah blah blah