A c/s project framework has been built over the past few days, and a problem that has not been noticed before is found:
After Project A (. csproj) under the same solution (. sln) references the. dll of Project B, you cannot find the corresponding namespace by using in the code.
As shown in figure 1, MCC. client references the. dll generated by the MCC. Business project, but in Figure 2,Error 2 the type or namespace name 'userprofile 'cocould not be found (Are you missing a using directive or an assembly reference ?) C: \ Documents ents and Settings \ a531032 \ My Documents ents \ Visual Studio 2010 \ projects \ MCC. Client \ sysutility \ appcontext. CS 15 24 MCC. Client.
Figure 1 Solution Structure
Figure 2 Compilation Error
Because I have modified the project name before and thought it was the cause of the reference failure, I checked the error in the following direction and finally found the cause.
- Check whether the assemblytitle and assemblyproduct files in the properties/assembly. CS file of the referenced Project (MCC. Business Project in this example) are correct? 3.
Figure 3 properties/assembly. CS file of MCC. Business
- Right-click to check whether the properties of the referenced Project (MCC. Business Project in this example) are correct? 4.
Figure 4 properties page of MCC. Business
- Check whether the value in. csproj of the referenced project is consistent with the assembly information of MCC. Business? 5.
Figure 5. csproj file of MCC. Client
- Check the property page of the referenced project. Is the field "target framework" set to ". NET Framework 4 client profile "? 6.
Figure 6 properties page of MCC. Client
Problem Found
My problem is that when creating the MCC. Client project (a winform project), vs 2010 selects ". NET Framework 4 client profile" by default to facilitate client deployment. However, because the MCC. dataaccess project references system. Data. oracleclient (it is not included in the. NET Framework 4 client profile library, but in the. NET Framework 4 full library ). Then, MCC. business references MCC. the. DLL, when MCC. client references MCC. generated by business. DLL. DLL references again. NET framework 4 client profile does not contain content, so MCC. client to MCC. business. DLL provides a compilation error.
======================================
Differences between. NET Framework 4 client profile and. NET framework 4
- Is a subset of the latter.
- Reduces the deployment time of. NET Framework and. NET Framework applications.
- Failed to deploy. NET Framework.
- Reduce the size of the. NET Framework in the isV software, so as to provide more space for the software.
- Reduce the "interface" of the system where the. NET Framework client profile is installed because the client profille contains ASP. NET and the components required by some servers.
- We can see the difference in size between the two.
Refer to blog posts from networks:
- Analysis and discussion of "unprecedented bug" on csdn
- Stackoverflow on foreigners
- . NET Framework 4 client profile, which is shared with. NET Framework 4 full. dll
For personal study, please refer to it for your reference only ~