前几天我在一台式机上用Blend处理了一下silverlight工程,保存了。
后来打开的时候,一直报什么安全问题。我没有在意。因为我点击确定后,该项目既能调试也能运行我就没有在意。可是今天我把该工程拷贝到一个笔记本上去运行,结果打开工程失败,也没与写原因。
最后我就找到该工程的.csproj文件,打开后,
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{22F71354-B52F-4B14-847A-E81F5AE2D79B}</ProjectGuid>
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>###</RootNamespace>
<AssemblyName>###</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<SilverlightApplication>true</SilverlightApplication>
<SupportedCultures>zh-Hans</SupportedCultures>
<XapOutputs>true</XapOutputs>
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
<XapFilename>###.xap</XapFilename>
<SilverlightManifestTemplate>Properties/AppManifest.xml</SilverlightManifestTemplate>
<SilverlightAppEntry>###.App</SilverlightAppEntry>
<TestPageFileName>TestPage.html</TestPageFileName>
<CreateTestPage>true</CreateTestPage>
<ValidateXaml>true</ValidateXaml>
<EnableOutOfBrowser>false</EnableOutOfBrowser>
<OutOfBrowserSettingsFile>Properties/OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
<UsePlatformExtensions>false</UsePlatformExtensions>
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
<LinkedServerProject>
</LinkedServerProject>
<ExpressionBlendVersion>3.0.1938.0</ExpressionBlendVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin/Release/</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin/Release</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FloatableWindow, Version=2.0.5.0, Culture=neutral, PublicKeyToken=dd6e2c92abf74ba1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>../../../../项目文档/实例/浮动窗口/FloatableWindow.dll</HintPath>
</Reference>
<Reference Include="GIFDecoder, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>../../../../项目文档/实例/读取图片/GIFDecoderSample/GIFDecoder/Bin/Debug/GIFDecoder.dll</HintPath>
</Reference>
<Reference Include="SLVisifire.Charts, Version=2.2.9.0, Culture=neutral, PublicKeyToken=e1555b029ff71bd3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:/SuperMap/SuperMapiServerJava6R/iClient/forSilverlight/lib/SLVisifire.Charts.dll</HintPath>
</Reference>
<Reference Include="SuperMap.Web, Version=6.0.0.6524, Culture=neutral, PublicKeyToken=1b8ee0f6e59677a8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:/SuperMap/SuperMapiServerJava6R/iClient/forSilverlight/lib/SuperMap.Web.dll</HintPath>
</Reference>
<Reference Include="SuperMap.Web.Controls, Version=6.0.0.6524, Culture=neutral, PublicKeyToken=1b8ee0f6e59677a8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:/SuperMap/SuperMapiServerJava6R/iClient/forSilverlight/lib/SuperMap.Web.Controls.dll</HintPath>
</Reference>
<Reference Include="SuperMap.Web.IS6, Version=6.0.0.6524, Culture=neutral, PublicKeyToken=1b8ee0f6e59677a8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:/SuperMap/SuperMapiServerJava6R/iClient/forSilverlight/lib/SuperMap.Web.IS6.dll</HintPath>
</Reference>
<Reference Include="System.Windows" />
<Reference Include="mscorlib" />
<Reference Include="system" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference Include="System.Windows.Controls.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference Include="System.Windows.Controls.Data.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Controls.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Controls.Navigation, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Interactivity, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" />
<Reference Include="System.Windows.Browser" />
<Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</ApplicationDefinition>
<Page Include="Assets/Style1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="Assets/Style2.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="Assets/Styles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="CityMoniter.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="Test.xaml">
<Generator>MSBuild:MarkupCompilePass1</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ToolTipExpand.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:MarkupCompilePass1</Generator>
</Page>
<Page Include="WelcomePage.xaml">
<Generator>MSBuild:MarkupCompilePass1</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="Properties/AppManifest.xml" />
</ItemGroup>
<ItemGroup>
<Resource Include="images/Station.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="images/xuanfu002_03.png" />
<Resource Include="images/xuanfu002_05.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)/Microsoft/Silverlight/v3.0/Microsoft.Silverlight.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
<SilverlightProjectProperties />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(MSBuildExtensionsPath)/Microsoft/Expression/Blend/3.0/Silverlight/Microsoft.Expression.Blend.Silverlight.targets" />
</Project>
我经过仔细检查,发现上面标红色的这句话有问题,因为我的笔记本机器上没有Blend,所以就报错了。我把它删掉后重新打开工程,就没有可以了。
希望看到我日志的朋友,如果你的工程也是和我类似,因为在别的环境中用过,而无法打开工程。就打开该文件找到相应的Import语句,把她删掉(即删掉有问题的语句)。