<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="yes" />
<probing privatePath="bin2"/>
</assemblyBinding>
</runtime>
如果动态文件放在根目录下的文件夹test/bin2里面,由test下Web.config来设置动态文件位置,
那privatePath得路径应该如何来写呢?我试过,都是调试时弹出错误信息,那位前辈能搞定,谢谢!
13 个解决方案
#1
用相对路径可以吗?你是怎样写的?
#2
<add key="pos" value="文件位置" />
获得
<ConfigurationSettings.AppSettings["pos"]
获得
<ConfigurationSettings.AppSettings["pos"]
#3
privatePath="test/bin2"
在子目录下Web.config的privatePath目录不知道怎么写才好
#4
你的好像没有问题啊。
下面是我的测试配置。
虚拟目录根目录是testWebApp
引用的dll放在了bin2目录下,是testWebApp\bin2.
而且msdn上也是这么写的, 参考 http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
下面是我的测试配置。
虚拟目录根目录是testWebApp
引用的dll放在了bin2目录下,是testWebApp\bin2.
而且msdn上也是这么写的, 参考 http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<probing privatePath="bin;bin2;bin3"/>
<publisherPolicy apply="yes" />
</assemblyBinding>
</runtime>
#5

#6
我对你这句话有疑问
问在子目录创建Web.config里如下
web.config必须放在asp.net应用程序的根目录下,而asp.net必须是website或者Virtualdirecotry.
我怀疑你没有创建application.也就是属性中的Application name必须不是灰的。如果是灰的,点击右边的Create就可以了。
问在子目录创建Web.config里如下
web.config必须放在asp.net应用程序的根目录下,而asp.net必须是website或者Virtualdirecotry.
我怀疑你没有创建application.也就是属性中的Application name必须不是灰的。如果是灰的,点击右边的Create就可以了。
#7
我在根目录下的Web.config配置的privatePath是没问题的,
我想在子目录创建多一个Web.config,也在里面新设置子目录dll文件夹,
在子目录里的Web.config这样设置
<probing privatePath="~/test/bin3/ClassLibrary2.dll"/>
<probing privatePath="../test/bin3/ClassLibrary2.dll"/>
都提示错误???
子目录的Web.config代码
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="yes" />
<probing privatePath="~/test/bin3/ClassLibrary2.dll"/>
</assemblyBinding>
</runtime>
</configuration>
中秋节快乐哦!!
#8
上面的目录被我写错了,ClassLibrary2.dll去掉,结果还是错的
#9
子目录里不能使用web.config吧。你得到的是什么错误?
如果不加probing 是不是也有错误?
#10
我写的那个程序集找不到,上次我问一个问题,说可以????http://topic.****.net/u/20100921/19/84c1b301-ba64-493f-9065-a00dc0e7b74a.html
#11
understood.
try
<probing privatePath=".\bin2;"/>
try
<probing privatePath=".\bin2;"/>
#12
还是停留在根目录下web.config没问题,
对于在子目录的web.config里设置该子目录的动态文件路径设置还是有问题,
在路径方面的写法,还有解决办法吗???
对于在子目录的web.config里设置该子目录的动态文件路径设置还是有问题,
在路径方面的写法,还有解决办法吗???
#13
我在xp的II5下试过了,<probing privatePath=".\bin2;"/>这样是可以的。
前提是子目录也必须创建VirtualDirectory.
#1
用相对路径可以吗?你是怎样写的?
#2
<add key="pos" value="文件位置" />
获得
<ConfigurationSettings.AppSettings["pos"]
获得
<ConfigurationSettings.AppSettings["pos"]
#3
privatePath="test/bin2"
在子目录下Web.config的privatePath目录不知道怎么写才好
#4
你的好像没有问题啊。
下面是我的测试配置。
虚拟目录根目录是testWebApp
引用的dll放在了bin2目录下,是testWebApp\bin2.
而且msdn上也是这么写的, 参考 http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
下面是我的测试配置。
虚拟目录根目录是testWebApp
引用的dll放在了bin2目录下,是testWebApp\bin2.
而且msdn上也是这么写的, 参考 http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<probing privatePath="bin;bin2;bin3"/>
<publisherPolicy apply="yes" />
</assemblyBinding>
</runtime>
#5

#6
我对你这句话有疑问
问在子目录创建Web.config里如下
web.config必须放在asp.net应用程序的根目录下,而asp.net必须是website或者Virtualdirecotry.
我怀疑你没有创建application.也就是属性中的Application name必须不是灰的。如果是灰的,点击右边的Create就可以了。
问在子目录创建Web.config里如下
web.config必须放在asp.net应用程序的根目录下,而asp.net必须是website或者Virtualdirecotry.
我怀疑你没有创建application.也就是属性中的Application name必须不是灰的。如果是灰的,点击右边的Create就可以了。
#7
我在根目录下的Web.config配置的privatePath是没问题的,
我想在子目录创建多一个Web.config,也在里面新设置子目录dll文件夹,
在子目录里的Web.config这样设置
<probing privatePath="~/test/bin3/ClassLibrary2.dll"/>
<probing privatePath="../test/bin3/ClassLibrary2.dll"/>
都提示错误???
子目录的Web.config代码
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="yes" />
<probing privatePath="~/test/bin3/ClassLibrary2.dll"/>
</assemblyBinding>
</runtime>
</configuration>
中秋节快乐哦!!
#8
上面的目录被我写错了,ClassLibrary2.dll去掉,结果还是错的
#9
子目录里不能使用web.config吧。你得到的是什么错误?
如果不加probing 是不是也有错误?
#10
我写的那个程序集找不到,上次我问一个问题,说可以????http://topic.****.net/u/20100921/19/84c1b301-ba64-493f-9065-a00dc0e7b74a.html
#11
understood.
try
<probing privatePath=".\bin2;"/>
try
<probing privatePath=".\bin2;"/>
#12
还是停留在根目录下web.config没问题,
对于在子目录的web.config里设置该子目录的动态文件路径设置还是有问题,
在路径方面的写法,还有解决办法吗???
对于在子目录的web.config里设置该子目录的动态文件路径设置还是有问题,
在路径方面的写法,还有解决办法吗???
#13
我在xp的II5下试过了,<probing privatePath=".\bin2;"/>这样是可以的。
前提是子目录也必须创建VirtualDirectory.